Re: Non-reproducible AIO failure
| От | Andres Freund |
|---|---|
| Тема | Re: Non-reproducible AIO failure |
| Дата | |
| Msg-id | o5y7dzugxpaidihm6z3qixuwz6cvz7nodqqhjdjoyk7lkudwv4@hjomnlzlt3ns обсуждение исходный текст |
| Ответ на | Re: Non-reproducible AIO failure (Nico Williams <nico@cryptonector.com>) |
| Ответы |
Re: Non-reproducible AIO failure
Re: Non-reproducible AIO failure |
| Список | pgsql-hackers |
Hi, I'm a bit confused by this focus on bitfields - both Alexander and Konstantin stated they could reproduce the issue without the bitfields. But we have observed the generated code being pretty grotty and it's caused more than enough confusion - so let's just replace them with plain uint8's and cast in switches. > I think the issue is that if the compiler decides to coalesce what we > think of as distinct (but neighboring) bitfields, then when you update > one of the bitfields you could be updating the other with stale data > from an earlier read where the cached stale data is cached in a > _register_. Thus the fact that the cache line should have the most up > to date data for that other field is irrelevant because the stale data > is in a _register_. > > The very fact that this can happen, that the C specs allow it, argues > that one must never have adjacent distinct (for some value of > "distinct") bitfields for anything that requires atomics. I think the barriers in place should prevent that. Greetings, Andres Freund
Вложения
В списке pgsql-hackers по дате отправления: