lkml.org 
[lkml]   [2005]   [Mar]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 1/2] BDI: Provide backing device capability information
Linus Torvalds <torvalds@osdl.org> wrote:
>
> On Wed, 2 Mar 2005, Andrew Morton wrote:
> >
> > Why not make these bitfields as well?
>
> Side note: bitfields aren't exactly wonderful.

Yup. In this application the fields are initialised once (usually at
compile time) and are never modified. So the compiler should be able to
generate the same code as it would with an open-coded bit test. Which is
about the only situation where we should use bitfields, IMO.

That being said, there aren't many backing_dev_info's in a system, so we
won't be saving much memory. Some architectures will presumably generate
faster code with plain old integers. You'd only ever lose if the
backing_dev_info happened to straddle a cacheline boundary. It's marginal.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 14:10    [W:0.187 / U:0.076 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site