Re: [PATCH 1/2] BDI: Provide backing device capability information [try #3]

2005-03-09 Thread David Howells
Andrew Morton <[EMAIL PROTECTED]> wrote: > > The attached patch replaces backing_dev_info::memory_backed with > > capabilitied bitmap. > > Looks sane to me, thanks. > > I hope you got all the conversions correct - breakage in the writeback > dirty accounting manifests in subtle ways. I'll doubl

Re: [PATCH 1/2] BDI: Provide backing device capability information [try #3]

2005-03-08 Thread Andrew Morton
David Howells <[EMAIL PROTECTED]> wrote: > > The attached patch replaces backing_dev_info::memory_backed with capabilitied > bitmap. Looks sane to me, thanks. I hope you got all the conversions correct - breakage in the writeback dirty accounting manifests in subtle ways. I'll double-check it. -

Re: [PATCH 1/2] BDI: Provide backing device capability information

2005-03-07 Thread Andrew Morton
Miklos Szeredi <[EMAIL PROTECTED]> wrote: > > > Sorry, yes. Obvious. Ugh. Andrew Morton suggested flipping the logic, and > > although it was in conjunction with turning the concepts into bitfields, it > > still stands here. > > OK, obviously Andrew has the final word in this. I just suggested >

Re: [PATCH 1/2] BDI: Provide backing device capability information

2005-03-07 Thread Miklos Szeredi
> Sorry, yes. Obvious. Ugh. Andrew Morton suggested flipping the logic, and > although it was in conjunction with turning the concepts into bitfields, it > still stands here. OK, obviously Andrew has the final word in this. I just suggested that it might be safer to have the logic flipped back.

Re: [PATCH 1/2] BDI: Provide backing device capability information

2005-03-07 Thread David Howells
Miklos Szeredi <[EMAIL PROTECTED]> wrote: > > It shouldn't silently break... It will refuse to compile. I renamed > > "memory_backed" to "capabilities". > > This will silently break: > > static struct backing_dev_info my_bdi = { >.ra_pages = MY_RA, >.unplug_io_fn = default_unplug

Re: [PATCH 1/2] BDI: Provide backing device capability information

2005-03-07 Thread Miklos Szeredi
> > Wouldn't it be better to reverse the meaning of BDI_CAP_ACCOUNT_DIRTY > > and BDI_CAP_WRITEBACK_DIRTY (BDI_CAP_NO_ACCOUNT_DIRTY...)? That way > > out of tree filesystems that implicitly zero bdi->memory_backed > > wouldn't _silently_ break. E.g. fuse does this, though it would not > > actuall

Re: [PATCH 1/2] BDI: Provide backing device capability information

2005-03-07 Thread David Howells
Miklos Szeredi <[EMAIL PROTECTED]> wrote: > > The attached patch replaces backing_dev_info::memory_backed with > > capabilitied bitmap. The capabilities available include: > > Wouldn't it be better to reverse the meaning of BDI_CAP_ACCOUNT_DIRTY > and BDI_CAP_WRITEBACK_DIRTY (BDI_CAP_NO_ACCOUNT_D

Re: [PATCH 1/2] BDI: Provide backing device capability information

2005-03-07 Thread Miklos Szeredi
> The attached patch replaces backing_dev_info::memory_backed with > capabilitied bitmap. The capabilities available include: Wouldn't it be better to reverse the meaning of BDI_CAP_ACCOUNT_DIRTY and BDI_CAP_WRITEBACK_DIRTY (BDI_CAP_NO_ACCOUNT_DIRTY...)? That way out of tree filesystems that impl

Re: [PATCH 1/2] BDI: Provide backing device capability information

2005-03-07 Thread David Howells
The attached patch replaces backing_dev_info::memory_backed with capabilitied bitmap. The capabilities available include: (*) BDI_CAP_ACCOUNT_DIRTY Set if the pages associated with this backing device should be tracked by dirty page accounting. (*) BDI_CAP_WRITEBACK_DIRTY

Re: [PATCH 1/2] BDI: Provide backing device capability information

2005-03-07 Thread David Howells
Andrew Morton <[EMAIL PROTECTED]> wrote: > > Making it unsigned long on a 32-bit machine will make no > > difference. Making it unsigned int on a 64-bit machine will waste four > > bytes. > > No, it won't waste any bytes at all. It won't save any either. > > But if someone comes along later and

Re: [PATCH 1/2] BDI: Provide backing device capability information

2005-03-07 Thread Andrew Morton
David Howells <[EMAIL PROTECTED]> wrote: > > Andrew Morton <[EMAIL PROTECTED]> wrote: > > > > Any particular reason? It's mixed in with other unsigned longs and > > > pointers > > > after all... > > > > Just that it's the natural wordsize of the machine, and uses less storage. > > Making it uns

Re: [PATCH 1/2] BDI: Provide backing device capability information

2005-03-07 Thread David Howells
Andrew Morton <[EMAIL PROTECTED]> wrote: > > Any particular reason? It's mixed in with other unsigned longs and pointers > > after all... > > Just that it's the natural wordsize of the machine, and uses less storage. Making it unsigned long on a 32-bit machine will make no difference. Making it

Re: [PATCH 1/2] BDI: Provide backing device capability information

2005-03-07 Thread Andrew Morton
David Howells <[EMAIL PROTECTED]> wrote: > > Andrew Morton <[EMAIL PROTECTED]> wrote: > > > > So I should fold the two other bitfields back into the capabilities mask > > > and make it an unsigned long. > > > > I suppose so. Although unsigned int would be preferable. > > Any particular reason

Re: [PATCH 1/2] BDI: Provide backing device capability information

2005-03-07 Thread David Howells
Andrew Morton <[EMAIL PROTECTED]> wrote: > > So I should fold the two other bitfields back into the capabilities mask > > and make it an unsigned long. > > I suppose so. Although unsigned int would be preferable. Any particular reason? It's mixed in with other unsigned longs and pointers afte

Re: [PATCH 1/2] BDI: Provide backing device capability information

2005-03-07 Thread Andrew Morton
David Howells <[EMAIL PROTECTED]> wrote: > > Andrew Morton <[EMAIL PROTECTED]> wrote: > > > > Making these into bitfields would result in having to use three > variables > > > instead of just the one. > > > > Well let's do one or the other, and not have it half-and-half, please. > > So I

Re: [PATCH 1/2] BDI: Provide backing device capability information

2005-03-07 Thread David Howells
Andrew Morton <[EMAIL PROTECTED]> wrote: > > Making these into bitfields would result in having to use three variables > > instead of just the one. > > Well let's do one or the other, and not have it half-and-half, please. So I should fold the two other bitfields back into the capabilities mas

Re: [PATCH 1/2] BDI: Provide backing device capability information

2005-03-03 Thread Andrew Morton
David Howells <[EMAIL PROTECTED]> wrote: > > Andrew Morton <[EMAIL PROTECTED]> wrote: > > > > > > +#define BDI_CAP_MAP_COPY0x0001 /* Copy can be mapped > (MAP_PRIVATE) */ > > > +#define BDI_CAP_MAP_DIRECT 0x0002 /* Can be mapped > directly (MAP_SHARED) */ > >

Re: [PATCH 1/2] BDI: Provide backing device capability information

2005-03-03 Thread Andrew Morton
David Howells <[EMAIL PROTECTED]> wrote: > > Andrew Morton <[EMAIL PROTECTED]> wrote: > > > Yup. In this application the fields are initialised once (usually at > > compile time) and are never modified. > > That's not exactly so. The block layer appears to modify them. See > blk_queue_make_reque

Re: [PATCH 1/2] BDI: Provide backing device capability information

2005-03-03 Thread David Howells
Andrew Morton <[EMAIL PROTECTED]> wrote: > Yup. In this application the fields are initialised once (usually at > compile time) and are never modified. That's not exactly so. The block layer appears to modify them. See blk_queue_make_request() in ll_rw_blk.c. David - To unsubscribe from this li

Re: [PATCH 1/2] BDI: Provide backing device capability information

2005-03-03 Thread David Howells
Andrew Morton <[EMAIL PROTECTED]> wrote: > > > +#define BDI_CAP_MAP_COPY 0x0001 /* Copy can be mapped > > (MAP_PRIVATE) */ > > +#define BDI_CAP_MAP_DIRECT 0x0002 /* Can be mapped directly > > (MAP_SHARED) */ > > Why not make these bitfields as well? Because I want to copy

Re: [PATCH 1/2] BDI: Provide backing device capability information

2005-03-02 Thread Andrew Morton
David Howells <[EMAIL PROTECTED]> wrote: > > > The attached patch does two things: > > (1) It gets rid of backing_dev_info::memory_backed and replaces it with a > pair of boolean values: > > (*) dirty_memory_acct > > True if the pages associated with this backing device sh

Re: [PATCH 1/2] BDI: Provide backing device capability information

2005-03-02 Thread Andrew Morton
Linus Torvalds <[EMAIL PROTECTED]> 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 t

Re: [PATCH 1/2] BDI: Provide backing device capability information

2005-03-02 Thread Linus Torvalds
On Wed, 2 Mar 2005, Andrew Morton wrote: > > Why not make these bitfields as well? Side note: bitfields aren't exactly wonderful. They tend to generate worse code, and they make it much harder to work with combinations of flags (both testing and initializing). They also have architecture-specifi