solving difficult htm problems without difficult hardware owen hofmann, donald porter, hany ramadan,...
DESCRIPTION
Difficult HTM Problems Enforcing atomicity and isolation requires conflict detection and rollback TM Hardware only applies to memory and processor state I/O, System calls may have effects that are not isolated, cannot be rolled back mov $norad, %eax mov $canada, %ebx launchmissiles %eax, %ebxTRANSCRIPT
![Page 1: Solving Difficult HTM Problems Without Difficult Hardware Owen Hofmann, Donald Porter, Hany Ramadan, Christopher Rossbach, and Emmett Witchel University](https://reader036.vdocuments.site/reader036/viewer/2022062504/5a4d1b657f8b9ab0599af6df/html5/thumbnails/1.jpg)
Solving Difficult HTM Problems Without Difficult HardwareOwen Hofmann, Donald Porter, Hany Ramadan,
Christopher Rossbach, and Emmett Witchel
University of Texas at Austin
![Page 2: Solving Difficult HTM Problems Without Difficult Hardware Owen Hofmann, Donald Porter, Hany Ramadan, Christopher Rossbach, and Emmett Witchel University](https://reader036.vdocuments.site/reader036/viewer/2022062504/5a4d1b657f8b9ab0599af6df/html5/thumbnails/2.jpg)
Intro
• Processors now scaling via cores, not clock rate• 8 cores now, 64 tomorrow, 4096 next week?
• Parallel programming increasingly important• Software must keep up with hardware advances• But parallel programming is really hard
• Deadlock, priority inversion, data races, etc.
• STM is here• We would like HTM
![Page 3: Solving Difficult HTM Problems Without Difficult Hardware Owen Hofmann, Donald Porter, Hany Ramadan, Christopher Rossbach, and Emmett Witchel University](https://reader036.vdocuments.site/reader036/viewer/2022062504/5a4d1b657f8b9ab0599af6df/html5/thumbnails/3.jpg)
Difficult HTM Problems
• Enforcing atomicity and isolation requires conflict detection and rollback
• TM Hardware only applies to memory and processor state• I/O, System calls may have effects that are not
isolated, cannot be rolled back
mov $norad, %eaxmov $canada, %ebxlaunchmissiles %eax, %ebx
![Page 4: Solving Difficult HTM Problems Without Difficult Hardware Owen Hofmann, Donald Porter, Hany Ramadan, Christopher Rossbach, and Emmett Witchel University](https://reader036.vdocuments.site/reader036/viewer/2022062504/5a4d1b657f8b9ab0599af6df/html5/thumbnails/4.jpg)
Outline
• Handling kernel I/O with minimal hardware• User-level system call rollback• Conclusions
![Page 5: Solving Difficult HTM Problems Without Difficult Hardware Owen Hofmann, Donald Porter, Hany Ramadan, Christopher Rossbach, and Emmett Witchel University](https://reader036.vdocuments.site/reader036/viewer/2022062504/5a4d1b657f8b9ab0599af6df/html5/thumbnails/5.jpg)
Outline
• Handling kernel I/O with minimal hardware• User-level system call rollback• Conclusions
![Page 6: Solving Difficult HTM Problems Without Difficult Hardware Owen Hofmann, Donald Porter, Hany Ramadan, Christopher Rossbach, and Emmett Witchel University](https://reader036.vdocuments.site/reader036/viewer/2022062504/5a4d1b657f8b9ab0599af6df/html5/thumbnails/6.jpg)
cxspinlocks
• Cooperative transactional spinlocks allow kernel to take advantage of limited TM hardware• Optimistically execute with transactions• Fall back on locking when hardware TM is not
enough• I/O, page table operations• overflow?
• Correctness provided by isolation of lock variable• Transactional threads read lock• Non-transactional threads write lock
![Page 7: Solving Difficult HTM Problems Without Difficult Hardware Owen Hofmann, Donald Porter, Hany Ramadan, Christopher Rossbach, and Emmett Witchel University](https://reader036.vdocuments.site/reader036/viewer/2022062504/5a4d1b657f8b9ab0599af6df/html5/thumbnails/7.jpg)
cxspinlock guarantees
• Multiple transactional threads in critical region• Non-transactional thread excludes all others
![Page 8: Solving Difficult HTM Problems Without Difficult Hardware Owen Hofmann, Donald Porter, Hany Ramadan, Christopher Rossbach, and Emmett Witchel University](https://reader036.vdocuments.site/reader036/viewer/2022062504/5a4d1b657f8b9ab0599af6df/html5/thumbnails/8.jpg)
cxspinlocks in action
Thread 1cx_optimistic(lockA);modify_data();if(condition) { perform_IO();}cx_end(lock);
Thread 2cx_optimistic(lockA);modify_data();cx_end(lock);
read write
unlocked
lockA:
read write
![Page 9: Solving Difficult HTM Problems Without Difficult Hardware Owen Hofmann, Donald Porter, Hany Ramadan, Christopher Rossbach, and Emmett Witchel University](https://reader036.vdocuments.site/reader036/viewer/2022062504/5a4d1b657f8b9ab0599af6df/html5/thumbnails/9.jpg)
cxspinlocks in action
Thread 1: TXcx_optimistic(lockA);modify_data();if(condition) { perform_IO();}cx_end(lock);
Thread 2: TXcx_optimistic(lockA);modify_data();cx_end(lock);
read writelockA
unlocked
lockA:
read writelockA
• Transactional threads read unlocked lock variable
![Page 10: Solving Difficult HTM Problems Without Difficult Hardware Owen Hofmann, Donald Porter, Hany Ramadan, Christopher Rossbach, and Emmett Witchel University](https://reader036.vdocuments.site/reader036/viewer/2022062504/5a4d1b657f8b9ab0599af6df/html5/thumbnails/10.jpg)
cxspinlocks in action
Thread 1: TXcx_optimistic(lockA);modify_data();if(condition) { perform_IO();}cx_end(lock);
Thread 2: TXcx_optimistic(lockA);modify_data();cx_end(lock);
read writelockA
unlocked
lockA:
read writelockA
• Transactional threads read unlocked lock variable
![Page 11: Solving Difficult HTM Problems Without Difficult Hardware Owen Hofmann, Donald Porter, Hany Ramadan, Christopher Rossbach, and Emmett Witchel University](https://reader036.vdocuments.site/reader036/viewer/2022062504/5a4d1b657f8b9ab0599af6df/html5/thumbnails/11.jpg)
cxspinlocks in action
Thread 1: TXcx_optimistic(lockA);modify_data();if(condition) { perform_IO();}cx_end(lock);
Thread 2:cx_optimistic(lockA);modify_data();cx_end(lock);
read writelockA
unlocked
lockA:
read writelockA
• Transactional threads read unlocked lock variable
![Page 12: Solving Difficult HTM Problems Without Difficult Hardware Owen Hofmann, Donald Porter, Hany Ramadan, Christopher Rossbach, and Emmett Witchel University](https://reader036.vdocuments.site/reader036/viewer/2022062504/5a4d1b657f8b9ab0599af6df/html5/thumbnails/12.jpg)
cxspinlocks in action
Thread 1:cx_optimistic(lockA);modify_data();if(condition) { perform_IO();}cx_end(lock);
Thread 2:cx_optimistic(lockA);modify_data();cx_end(lock);
read write
unlocked
lockA:
read write
![Page 13: Solving Difficult HTM Problems Without Difficult Hardware Owen Hofmann, Donald Porter, Hany Ramadan, Christopher Rossbach, and Emmett Witchel University](https://reader036.vdocuments.site/reader036/viewer/2022062504/5a4d1b657f8b9ab0599af6df/html5/thumbnails/13.jpg)
cxspinlocks in action
Thread 1:cx_optimistic(lockA);modify_data();if(condition) { perform_IO();}cx_end(lock);
Thread 2:cx_optimistic(lockA);modify_data();cx_end(lock);
read write
unlocked
lockA:
read write
![Page 14: Solving Difficult HTM Problems Without Difficult Hardware Owen Hofmann, Donald Porter, Hany Ramadan, Christopher Rossbach, and Emmett Witchel University](https://reader036.vdocuments.site/reader036/viewer/2022062504/5a4d1b657f8b9ab0599af6df/html5/thumbnails/14.jpg)
cxspinlocks in action
Thread 1: TXcx_optimistic(lockA);modify_data();if(condition) { perform_IO();}cx_end(lock);
Thread 2: TXcx_optimistic(lockA);modify_data();cx_end(lock);
read writelockA
unlocked
lockA:
read writelockA
![Page 15: Solving Difficult HTM Problems Without Difficult Hardware Owen Hofmann, Donald Porter, Hany Ramadan, Christopher Rossbach, and Emmett Witchel University](https://reader036.vdocuments.site/reader036/viewer/2022062504/5a4d1b657f8b9ab0599af6df/html5/thumbnails/15.jpg)
cxspinlocks in action
Thread 1: TXcx_optimistic(lockA);modify_data();if(condition) { perform_IO();}cx_end(lock);
Thread 2: TXcx_optimistic(lockA);modify_data();cx_end(lock);
read writelockA
unlocked
lockA:
read writelockA
![Page 16: Solving Difficult HTM Problems Without Difficult Hardware Owen Hofmann, Donald Porter, Hany Ramadan, Christopher Rossbach, and Emmett Witchel University](https://reader036.vdocuments.site/reader036/viewer/2022062504/5a4d1b657f8b9ab0599af6df/html5/thumbnails/16.jpg)
cxspinlocks in action
Thread 1: TXcx_optimistic(lockA);modify_data();if(condition) { perform_IO();}cx_end(lock);
Thread 2: TXcx_optimistic(lockA);modify_data();cx_end(lock);
read writelockA
unlocked
lockA:
read writelockA
![Page 17: Solving Difficult HTM Problems Without Difficult Hardware Owen Hofmann, Donald Porter, Hany Ramadan, Christopher Rossbach, and Emmett Witchel University](https://reader036.vdocuments.site/reader036/viewer/2022062504/5a4d1b657f8b9ab0599af6df/html5/thumbnails/17.jpg)
cxspinlocks in action
Thread 1: TXcx_optimistic(lockA);modify_data();if(condition) { perform_IO();}cx_end(lock);
Thread 2: TXcx_optimistic(lockA);modify_data();cx_end(lock);
read writelockA
unlocked
lockA:
read writelockA
• Hardware restarts transactions for I/O
![Page 18: Solving Difficult HTM Problems Without Difficult Hardware Owen Hofmann, Donald Porter, Hany Ramadan, Christopher Rossbach, and Emmett Witchel University](https://reader036.vdocuments.site/reader036/viewer/2022062504/5a4d1b657f8b9ab0599af6df/html5/thumbnails/18.jpg)
cxspinlocks in action
Thread 1:cx_optimistic(lockA);modify_data();if(condition) { perform_IO();}cx_end(lock);
Thread 2: TXcx_optimistic(lockA);modify_data();cx_end(lock);
read write
unlocked
lockA:
read writelockA
![Page 19: Solving Difficult HTM Problems Without Difficult Hardware Owen Hofmann, Donald Porter, Hany Ramadan, Christopher Rossbach, and Emmett Witchel University](https://reader036.vdocuments.site/reader036/viewer/2022062504/5a4d1b657f8b9ab0599af6df/html5/thumbnails/19.jpg)
cxspinlocks in action
Thread 1:cx_optimistic(lockA);modify_data();if(condition) { perform_IO();}cx_end(lock);
Thread 2: TXcx_optimistic(lockA);modify_data();cx_end(lock);
read write
unlocked
lockA:
read writelockA
• contention managed CAS
![Page 20: Solving Difficult HTM Problems Without Difficult Hardware Owen Hofmann, Donald Porter, Hany Ramadan, Christopher Rossbach, and Emmett Witchel University](https://reader036.vdocuments.site/reader036/viewer/2022062504/5a4d1b657f8b9ab0599af6df/html5/thumbnails/20.jpg)
cxspinlocks in action
Thread 1:cx_optimistic(lockA);modify_data();if(condition) { perform_IO();}cx_end(lock);
Thread 2: TXcx_optimistic(lockA);modify_data();cx_end(lock);
read write
unlocked
lockA:
read writelockA
• contention managed CAS
![Page 21: Solving Difficult HTM Problems Without Difficult Hardware Owen Hofmann, Donald Porter, Hany Ramadan, Christopher Rossbach, and Emmett Witchel University](https://reader036.vdocuments.site/reader036/viewer/2022062504/5a4d1b657f8b9ab0599af6df/html5/thumbnails/21.jpg)
cxspinlocks in action
Thread 1:cx_optimistic(lockA);modify_data();if(condition) { perform_IO();}cx_end(lock);
Thread 2:cx_optimistic(lockA);modify_data();cx_end(lock);
read write
unlocked
lockA:
read write
• contention managed CAS
![Page 22: Solving Difficult HTM Problems Without Difficult Hardware Owen Hofmann, Donald Porter, Hany Ramadan, Christopher Rossbach, and Emmett Witchel University](https://reader036.vdocuments.site/reader036/viewer/2022062504/5a4d1b657f8b9ab0599af6df/html5/thumbnails/22.jpg)
cxspinlocks in action
Thread 1: Non-TXcx_optimistic(lockA);modify_data();if(condition) { perform_IO();}cx_end(lock);
Thread 2:cx_optimistic(lockA);modify_data();cx_end(lock);
read write
lockedlockA:
read write
![Page 23: Solving Difficult HTM Problems Without Difficult Hardware Owen Hofmann, Donald Porter, Hany Ramadan, Christopher Rossbach, and Emmett Witchel University](https://reader036.vdocuments.site/reader036/viewer/2022062504/5a4d1b657f8b9ab0599af6df/html5/thumbnails/23.jpg)
cxspinlocks in action
Thread 1: Non-TXcx_optimistic(lockA);modify_data();if(condition) { perform_IO();}cx_end(lock);
Thread 2:cx_optimistic(lockA);modify_data();cx_end(lock);
read write
lockedlockA:
read write
![Page 24: Solving Difficult HTM Problems Without Difficult Hardware Owen Hofmann, Donald Porter, Hany Ramadan, Christopher Rossbach, and Emmett Witchel University](https://reader036.vdocuments.site/reader036/viewer/2022062504/5a4d1b657f8b9ab0599af6df/html5/thumbnails/24.jpg)
cxspinlocks in action
Thread 1: Non-TXcx_optimistic(lockA);modify_data();if(condition) { perform_IO();}cx_end(lock);
Thread 2:cx_optimistic(lockA);modify_data();cx_end(lock);
read write
lockedlockA:
read write
![Page 25: Solving Difficult HTM Problems Without Difficult Hardware Owen Hofmann, Donald Porter, Hany Ramadan, Christopher Rossbach, and Emmett Witchel University](https://reader036.vdocuments.site/reader036/viewer/2022062504/5a4d1b657f8b9ab0599af6df/html5/thumbnails/25.jpg)
cxspinlocks in action
Thread 1: Non-TXcx_optimistic(lockA);modify_data();if(condition) { perform_IO();}cx_end(lock);
Thread 2: TXcx_optimistic(lockA);modify_data();cx_end(lock);
read write
lockedlockA:
read write
• conditionally add variable to read set
![Page 26: Solving Difficult HTM Problems Without Difficult Hardware Owen Hofmann, Donald Porter, Hany Ramadan, Christopher Rossbach, and Emmett Witchel University](https://reader036.vdocuments.site/reader036/viewer/2022062504/5a4d1b657f8b9ab0599af6df/html5/thumbnails/26.jpg)
cxspinlocks in action
Thread 1: Non-TXcx_optimistic(lockA);modify_data();if(condition) { perform_IO();}cx_end(lock);
Thread 2: TXcx_optimistic(lockA);modify_data();cx_end(lock);
read write
lockedlockA:
read write
• conditionally add variable to read set
![Page 27: Solving Difficult HTM Problems Without Difficult Hardware Owen Hofmann, Donald Porter, Hany Ramadan, Christopher Rossbach, and Emmett Witchel University](https://reader036.vdocuments.site/reader036/viewer/2022062504/5a4d1b657f8b9ab0599af6df/html5/thumbnails/27.jpg)
cxspinlocks in action
Thread 1:cx_optimistic(lockA);modify_data();if(condition) { perform_IO();}cx_end(lock);
Thread 2: TXcx_optimistic(lockA);modify_data();cx_end(lock);
read write
unlocked
lockA:
read write
• conditionally add variable to read set
![Page 28: Solving Difficult HTM Problems Without Difficult Hardware Owen Hofmann, Donald Porter, Hany Ramadan, Christopher Rossbach, and Emmett Witchel University](https://reader036.vdocuments.site/reader036/viewer/2022062504/5a4d1b657f8b9ab0599af6df/html5/thumbnails/28.jpg)
cxspinlocks in action
Thread 1:cx_optimistic(lockA);modify_data();if(condition) { perform_IO();}cx_end(lock);
Thread 2: TXcx_optimistic(lockA);modify_data();cx_end(lock);
read write
unlocked
lockA:
read writelockA
![Page 29: Solving Difficult HTM Problems Without Difficult Hardware Owen Hofmann, Donald Porter, Hany Ramadan, Christopher Rossbach, and Emmett Witchel University](https://reader036.vdocuments.site/reader036/viewer/2022062504/5a4d1b657f8b9ab0599af6df/html5/thumbnails/29.jpg)
cxspinlocks in action
Thread 1:cx_optimistic(lockA);modify_data();if(condition) { perform_IO();}cx_end(lock);
Thread 2: TXcx_optimistic(lockA);modify_data();cx_end(lock);
read write
unlocked
lockA:
read writelockA
![Page 30: Solving Difficult HTM Problems Without Difficult Hardware Owen Hofmann, Donald Porter, Hany Ramadan, Christopher Rossbach, and Emmett Witchel University](https://reader036.vdocuments.site/reader036/viewer/2022062504/5a4d1b657f8b9ab0599af6df/html5/thumbnails/30.jpg)
cxspinlocks in action
Thread 1:cx_optimistic(lockA);modify_data();if(condition) { perform_IO();}cx_end(lock);
Thread 2:cx_optimistic(lockA);modify_data();cx_end(lock);
read write
unlocked
lockA:
read write
![Page 31: Solving Difficult HTM Problems Without Difficult Hardware Owen Hofmann, Donald Porter, Hany Ramadan, Christopher Rossbach, and Emmett Witchel University](https://reader036.vdocuments.site/reader036/viewer/2022062504/5a4d1b657f8b9ab0599af6df/html5/thumbnails/31.jpg)
Implementing cxspinlocks• Return codes: Correctness
• Hardware returns status code from xbegin to indicate when hardware has failed (I/O)
• xtest: Performance• Conditionally add a memory cell (e.g. lock
variable) to the read set based on its value• xcas: Fairness
• Contention managed CAS• Non-transactional threads can wait for
transactional threads• Simple hardware primitives support
complicated behaviors without implementing them
![Page 32: Solving Difficult HTM Problems Without Difficult Hardware Owen Hofmann, Donald Porter, Hany Ramadan, Christopher Rossbach, and Emmett Witchel University](https://reader036.vdocuments.site/reader036/viewer/2022062504/5a4d1b657f8b9ab0599af6df/html5/thumbnails/32.jpg)
Outline
• Handling kernel I/O with minimal hardware• User-level system call rollback• Conclusions
![Page 33: Solving Difficult HTM Problems Without Difficult Hardware Owen Hofmann, Donald Porter, Hany Ramadan, Christopher Rossbach, and Emmett Witchel University](https://reader036.vdocuments.site/reader036/viewer/2022062504/5a4d1b657f8b9ab0599af6df/html5/thumbnails/33.jpg)
User-level system call rollback
• Open nesting requires user-level syscall rollback
• Many calls have clear inverses• mmap, munmap
• Even simple calls have many side effects• e.g. file write
• Even simple calls might be irreversible
![Page 34: Solving Difficult HTM Problems Without Difficult Hardware Owen Hofmann, Donald Porter, Hany Ramadan, Christopher Rossbach, and Emmett Witchel University](https://reader036.vdocuments.site/reader036/viewer/2022062504/5a4d1b657f8b9ab0599af6df/html5/thumbnails/34.jpg)
Users can’t always roll backfd_A = open(“file_A”);unlink(“file_A”);void *map_A =
mmap(fd=fd_A, size=4096);
close(fd_A);
xbegin;modify_data();fd_B = open(“file_B”);xbegin_open;void *map_B =
mmap(fd=fd_B, start=map_A,size=4096);
xend_open(abort_action=munmap);
xrestart;
![Page 35: Solving Difficult HTM Problems Without Difficult Hardware Owen Hofmann, Donald Porter, Hany Ramadan, Christopher Rossbach, and Emmett Witchel University](https://reader036.vdocuments.site/reader036/viewer/2022062504/5a4d1b657f8b9ab0599af6df/html5/thumbnails/35.jpg)
Users can’t always roll backfd_A = open(“file_A”);unlink(“file_A”);void *map_A =
mmap(fd=fd_A, size=4096);
close(fd_A);
xbegin;modify_data();fd_B = open(“file_B”);xbegin_open;void *map_B =
mmap(fd=fd_B, start=map_A,size=4096);
xend_open(abort_action=munmap);
xrestart;
![Page 36: Solving Difficult HTM Problems Without Difficult Hardware Owen Hofmann, Donald Porter, Hany Ramadan, Christopher Rossbach, and Emmett Witchel University](https://reader036.vdocuments.site/reader036/viewer/2022062504/5a4d1b657f8b9ab0599af6df/html5/thumbnails/36.jpg)
Users can’t always roll backfd_A = open(“file_A”);unlink(“file_A”);void *map_A =
mmap(fd=fd_A, size=4096);
close(fd_A);
xbegin;modify_data();fd_B = open(“file_B”);xbegin_open;void *map_B =
mmap(fd=fd_B, start=map_A,size=4096);
xend_open(abort_action=munmap);
xrestart;
![Page 37: Solving Difficult HTM Problems Without Difficult Hardware Owen Hofmann, Donald Porter, Hany Ramadan, Christopher Rossbach, and Emmett Witchel University](https://reader036.vdocuments.site/reader036/viewer/2022062504/5a4d1b657f8b9ab0599af6df/html5/thumbnails/37.jpg)
Users can’t always roll backfd_A = open(“file_A”);unlink(“file_A”);void *map_A =
mmap(fd=fd_A, size=4096);
close(fd_A);
xbegin;modify_data();fd_B = open(“file_B”);xbegin_open;void *map_B =
mmap(fd=fd_B, start=map_A,size=4096);
xend_open(abort_action=munmap);
xrestart;
![Page 38: Solving Difficult HTM Problems Without Difficult Hardware Owen Hofmann, Donald Porter, Hany Ramadan, Christopher Rossbach, and Emmett Witchel University](https://reader036.vdocuments.site/reader036/viewer/2022062504/5a4d1b657f8b9ab0599af6df/html5/thumbnails/38.jpg)
Users can’t always roll backfd_A = open(“file_A”);unlink(“file_A”);void *map_A =
mmap(fd=fd_A, size=4096);
close(fd_A);
xbegin;modify_data();fd_B = open(“file_B”);xbegin_open;void *map_B =
mmap(fd=fd_B, start=map_A,size=4096);
xend_open(abort_action=munmap);
xrestart;
![Page 39: Solving Difficult HTM Problems Without Difficult Hardware Owen Hofmann, Donald Porter, Hany Ramadan, Christopher Rossbach, and Emmett Witchel University](https://reader036.vdocuments.site/reader036/viewer/2022062504/5a4d1b657f8b9ab0599af6df/html5/thumbnails/39.jpg)
Users can’t always roll backfd_A = open(“file_A”);unlink(“file_A”);void *map_A =
mmap(fd=fd_A, size=4096);
close(fd_A);
xbegin;modify_data();fd_B = open(“file_B”);xbegin_open;void *map_B =
mmap(fd=fd_B, start=map_A,size=4096);
xend_open(abort_action=munmap);
xrestart;
![Page 40: Solving Difficult HTM Problems Without Difficult Hardware Owen Hofmann, Donald Porter, Hany Ramadan, Christopher Rossbach, and Emmett Witchel University](https://reader036.vdocuments.site/reader036/viewer/2022062504/5a4d1b657f8b9ab0599af6df/html5/thumbnails/40.jpg)
Users can’t always roll backfd_A = open(“file_A”);unlink(“file_A”);void *map_A =
mmap(fd=fd_A, size=4096);
close(fd_A);
xbegin;modify_data();fd_B = open(“file_B”);xbegin_open;void *map_B =
mmap(fd=fd_B, start=map_A,size=4096);
xend_open(abort_action=munmap);
xrestart;
![Page 41: Solving Difficult HTM Problems Without Difficult Hardware Owen Hofmann, Donald Porter, Hany Ramadan, Christopher Rossbach, and Emmett Witchel University](https://reader036.vdocuments.site/reader036/viewer/2022062504/5a4d1b657f8b9ab0599af6df/html5/thumbnails/41.jpg)
Users can’t always roll backfd_A = open(“file_A”);unlink(“file_A”);void *map_A =
mmap(fd=fd_A, size=4096);
close(fd_A);
xbegin;modify_data();fd_B = open(“file_B”);xbegin_open;void *map_B =
mmap(fd=fd_B, start=map_A,size=4096);
xend_open(abort_action=munmap);
xrestart;
![Page 42: Solving Difficult HTM Problems Without Difficult Hardware Owen Hofmann, Donald Porter, Hany Ramadan, Christopher Rossbach, and Emmett Witchel University](https://reader036.vdocuments.site/reader036/viewer/2022062504/5a4d1b657f8b9ab0599af6df/html5/thumbnails/42.jpg)
Users can’t always roll backfd_A = open(“file_A”);unlink(“file_A”);void *map_A =
mmap(fd=fd_A, size=4096);
close(fd_A);
xbegin;modify_data();fd_B = open(“file_B”);xbegin_open;void *map_B =
mmap(fd=fd_B, start=map_A,size=4096);
xend_open(abort_action=munmap);
xrestart;
![Page 43: Solving Difficult HTM Problems Without Difficult Hardware Owen Hofmann, Donald Porter, Hany Ramadan, Christopher Rossbach, and Emmett Witchel University](https://reader036.vdocuments.site/reader036/viewer/2022062504/5a4d1b657f8b9ab0599af6df/html5/thumbnails/43.jpg)
Users can’t always roll backfd_A = open(“file_A”);unlink(“file_A”);void *map_A =
mmap(fd=fd_A, size=4096);
close(fd_A);
xbegin;modify_data();fd_B = open(“file_B”);xbegin_open;void *map_B =
mmap(fd=fd_B, start=map_A,size=4096);
xend_open(abort_action=munmap);
xrestart;
![Page 44: Solving Difficult HTM Problems Without Difficult Hardware Owen Hofmann, Donald Porter, Hany Ramadan, Christopher Rossbach, and Emmett Witchel University](https://reader036.vdocuments.site/reader036/viewer/2022062504/5a4d1b657f8b9ab0599af6df/html5/thumbnails/44.jpg)
Users can’t always roll backfd_A = open(“file_A”);unlink(“file_A”);void *map_A =
mmap(fd=fd_A, size=4096);
close(fd_A);
xbegin;modify_data();fd_B = open(“file_B”);xbegin_open;void *map_B =
mmap(fd=fd_B, start=map_A,size=4096);
xend_open(abort_action=munmap);
xrestart;
![Page 45: Solving Difficult HTM Problems Without Difficult Hardware Owen Hofmann, Donald Porter, Hany Ramadan, Christopher Rossbach, and Emmett Witchel University](https://reader036.vdocuments.site/reader036/viewer/2022062504/5a4d1b657f8b9ab0599af6df/html5/thumbnails/45.jpg)
Users can’t always roll backfd_A = open(“file_A”);unlink(“file_A”);void *map_A =
mmap(fd=fd_A, size=4096);
close(fd_A);
xbegin;modify_data();fd_B = open(“file_B”);xbegin_open;void *map_B =
mmap(fd=fd_B, start=map_A,size=4096);
xend_open(abort_action=munmap);
xrestart;
![Page 46: Solving Difficult HTM Problems Without Difficult Hardware Owen Hofmann, Donald Porter, Hany Ramadan, Christopher Rossbach, and Emmett Witchel University](https://reader036.vdocuments.site/reader036/viewer/2022062504/5a4d1b657f8b9ab0599af6df/html5/thumbnails/46.jpg)
Users can’t always roll backfd_A = open(“file_A”);unlink(“file_A”);void *map_A =
mmap(fd=fd_A, size=4096);
close(fd_A);
xbegin;modify_data();fd_B = open(“file_B”);xbegin_open;void *map_B =
mmap(fd=fd_B, start=map_A,size=4096);
xend_open(abort_action=munmap);
xrestart;
![Page 47: Solving Difficult HTM Problems Without Difficult Hardware Owen Hofmann, Donald Porter, Hany Ramadan, Christopher Rossbach, and Emmett Witchel University](https://reader036.vdocuments.site/reader036/viewer/2022062504/5a4d1b657f8b9ab0599af6df/html5/thumbnails/47.jpg)
Kernel participation required
• Users can’t track all syscall side effects• Must also track all non-tx syscalls
• Kernel must manage transactional syscalls• Kernel enhances user-level programming
model• Seamless transactional system calls• Strong isolation for system calls?
![Page 48: Solving Difficult HTM Problems Without Difficult Hardware Owen Hofmann, Donald Porter, Hany Ramadan, Christopher Rossbach, and Emmett Witchel University](https://reader036.vdocuments.site/reader036/viewer/2022062504/5a4d1b657f8b9ab0599af6df/html5/thumbnails/48.jpg)
Related Work
• Other I/O solutions• Hardware open nesting [Moravan 06]• Unrestricted transactions [Blundell 07]
• Transactional Locks• Speculative lock elision [Rajwar 01]• Transparently Reconciling Transactions & Locks
[Welc 06]• Simple hardware models
• Hybrid TM [Damron 06, Shriraman 07]• Hardware-accelerated STM [Saha 2006]
![Page 49: Solving Difficult HTM Problems Without Difficult Hardware Owen Hofmann, Donald Porter, Hany Ramadan, Christopher Rossbach, and Emmett Witchel University](https://reader036.vdocuments.site/reader036/viewer/2022062504/5a4d1b657f8b9ab0599af6df/html5/thumbnails/49.jpg)
Conclusions
• Kernel can use even minimal hardware TM designs• May not get full programming model• Simple primitives support complex behavior
• User-level programs can’t roll back system calls• Kernel must participate