Re: [RFC] pgflags_t

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Oct 06, 2021 at 05:23:49PM +0200, David Hildenbrand wrote:
> On 06.10.21 17:22, Al Viro wrote:
> > On Wed, Oct 06, 2021 at 03:58:14PM +0100, Matthew Wilcox wrote:
> > > David expressed some unease about the lack of typesafety in patches
> > > 1 & 2 of the page->slab conversion [1], and I'll admit to not being
> > > particularly a fan of passing around an unsigned long.  That crystallised
> > > in a discussion with Kent [2] about how to lock a page when you don't know
> > > its type (solution: every memory descriptor type starts with a
> > > pgflags_t)
> > 
> > Why bother making it a struct?  What's wrong with __bitwise and letting
> > sparse catch conversions?
> > 
> 
> As I raised in my reply, we store all kinds of different things in
> page->flags ... not sure if that could be worked around somehow.

What of that?  Inline helpers with force-casts for accessing those and
that's it...

Use of __bitwise is simply invisible to compiler - it doesn't get past the
preprocessor on non-sparse builds.  So it's not like you'd disrupt the
atomic accesses, layout, etc.




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux