CppCon 2017: Fedor Pikus “Read, Copy, Update, then what? RCU for non-kernel programmers”

  Рет қаралды 35,639

CppCon

CppCon

Күн бұрын

Пікірлер: 17
@almightysquirrel4679
@almightysquirrel4679 7 жыл бұрын
Great video. Everything very intuitively described, I liked video about atomics by Fedor Pikus also. Great job! Waiting for your videos next year, thanks.
@GeorgeTsiros
@GeorgeTsiros 5 жыл бұрын
17:18 "you do the modulo to get the index of the block and then you do the remainder to get the position of the data in the block", obviously he meant to say "division" (ie quotient), not modulo. (*(p[i/N]))[i%N] or something, i do not remember precedence of dereference
@jimlin897
@jimlin897 6 жыл бұрын
Wonderful talk! Thanks!
@andmefikri7555
@andmefikri7555 2 жыл бұрын
Thank you! This talk was amazing :D
@CppCon
@CppCon 2 жыл бұрын
Glad it was helpful!
@on-hv9co
@on-hv9co Жыл бұрын
Please correct me, because I want to be wrong about this: Isn't there a race condition between rcu_read_lock and synchronize_rcu? lets say a reader grabs generation N, and the current ref count is 0; there is some time between the execution of the generation load and the refcount increment. In this time between generation load and refcount increment, synchronize_rcu is called and gets current generation N and increments it. Before the reader thread has a change to get its increment in, the writer sees that refcount is 0 and proceeds to release the memory. the reader finally comes back to life and attempts to use the handle it was guaranteed to have life time support for but its resource is no longer alive. However improbable, can this race condition occur?
@guillaumecourrier7489
@guillaumecourrier7489 Жыл бұрын
I don't think this is the case. If you look at the synchronize_rcu implementation that was shown, it will store the current generation value N in last_gen and will do the cleanup of each generation from last_gc_gen to last_gen excluded. So if a reader grabs generation N the writter will do the cleanup up to N - 1. I think synchronize_rcu will not cleanup the memory of the current and previous generations in the code that was shown.
@Ricky-kx6pf
@Ricky-kx6pf Жыл бұрын
@@guillaumecourrier7489 Please correct me, what if synchronize_rcu is called twice between the execution of the generation load and the refcount increment?
@jjaychen
@jjaychen Жыл бұрын
@@Ricky-kx6pfCurious about this, too. Did you figure it out?
@sunjc826
@sunjc826 Жыл бұрын
@@jjaychen I was thinking you could do a double check, before getting the handle and after getting the handle, and return the handle only when the generation count has not changed. That way, you can guarantee the increment was registered. Somewhat similar to what the SeqLock does?
@blah0123455
@blah0123455 9 ай бұрын
I had the same question. I think a loop that does a double check makes sense. It would guarantee correctness, and If the generation isn't updated often, then most of the time the generation numbers would match and so the double check loop wouldn't be too costly either.
@aniketbisht2823
@aniketbisht2823 9 ай бұрын
57:13 "Readers can crash", I hope it's not because of undefined behavior.
@hazemzamalkawy14
@hazemzamalkawy14 4 жыл бұрын
Thank you really great video.
@kamalabuhenamostafa
@kamalabuhenamostafa 7 жыл бұрын
I know that will works, because i write language based, asked data scientist to check our backend,
Муж внезапно вернулся домой @Oscar_elteacher
00:43
История одного вокалиста
Рет қаралды 6 МЛН
Ice Cream or Surprise Trip Around the World?
00:31
Hungry FAM
Рет қаралды 22 МЛН
Симбу закрыли дома?! 🔒 #симба #симбочка #арти
00:41
Симбочка Пимпочка
Рет қаралды 4,7 МЛН
CppCon 2018: Fedor Pikus “Design for Performance”
1:03:40
RCU's First-Ever CVE, and How I Lived to Tell the Tale
43:24
linux.conf.au
Рет қаралды 9 М.
CS 134 OS-22:  RCU-Intro
15:27
Neil Rhodes
Рет қаралды 3,6 М.
Муж внезапно вернулся домой @Oscar_elteacher
00:43
История одного вокалиста
Рет қаралды 6 МЛН