On Wed, Jun 19, 2013 at 14:19, Marc Espie wrote: > On Wed, Jun 19, 2013 at 01:40:19PM +0200, Martin Pelikan wrote: >> > If you're right that atomic_{clear,set}bits_int is correct and >> > sufficient and actually faster, then all dynamic executables would >> > benefit from this speedup (sigprocmask is used in ld.so(1)). >> >> Since on i386 GENERIC these atomic_* things don't emit the LOCK prefix, >> performance shouldn't be an issue; I'm actually more worried about this > bit: >> >> > > - p->p_sigmask = mask &~ sigcantmask; >> > > + p->p_sigmask = mask; >> >> On the right architecture where a word store isn't atomic enough and >> with the right compiler that decides to put p_sigmask on an address >> ending with 0xFFF with 4k-sized pages, we have two problems already. > > If I read the code correctly, just adding an alignment constraint > to pool_init for the proc_pool would fix that 2nd part.
pool will never give you an object that spans pages (unless the object itself is larger than a page). p_sigmask will always be aligned nicely. i mean, if it weren't, that code already would crash.