linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Peter Zijlstra <a.p.zijlstra@chello.nl>
To: Neil Brown <neilb@suse.de>
Cc: Miklos Szeredi <miklos@szeredi.hu>,
	fengguang.wu@gmail.com, linux-kernel@vger.kernel.org
Subject: Re: [patch 1/3] bdi patches
Date: Wed, 05 Dec 2007 11:22:04 +0100	[thread overview]
Message-ID: <1196850124.6788.22.camel@twins> (raw)
In-Reply-To: <18255.24276.519113.975347@notabene.brown>

[-- Attachment #1: Type: text/plain, Size: 2843 bytes --]


On Fri, 2007-11-30 at 11:52 +1100, Neil Brown wrote:
> On Thursday November 29, miklos@szeredi.hu wrote:
> > > http://programming.kicks-ass.net/kernel-patches/foo/
> > > 
> > > bdi-task-dirty.patch
> > > bdi-sysfs.patch
> > > bdi-min.patch
> > > bdi-max.patch
> > > 
> > > 
> > > Is my current rather experimental stack, I just wrote the max part after
> > > having slept on it. I'm not fond of the multiplication there, but I
> > > dno't see a way around it.
> > > 
> > > Compile tested only.
> > 
> > I've done some testing on these patches and did some changes. So here
> > they go.
> > 
> > Thanks,
> > Miklos
> > 
> > ---------
> > Subject: mm: sysfs: expose the BDI object in sysfs
> > 
> > Provide a place in sysfs for the backing_dev_info object.
> > This allows us to see and set the various BDI specific variables.
> 
> You don't say what the place is, and I'm not quite familiar enough
> with sysfs internals to figure it out my self.  Help?

/sys/class/bdi/<name>/

> And while I was looking I noticed that bdi_register (and bdi_init_fmt)
> takes a second argument 'parent', which is always NULL, and which is
> undocumented as to purpose.
> If no-one would ever add another call to bdi_register, why have the
> second arg, and if they might, how would they know what to put there?

As Kay said, that is to be used once there are proper BDI parent
objects. (The block layer conversion from kobject to device should
provide some).

> Finally, the omission of NFS bothers me - and makes me wonder if the
> choice of name in sysfs is appropriate.

That is due to a currently silly filename limit in sysfs that is being
worked on by Greg and Kay.

> Would a program ever want to generate the name (in sysfs) for a
> particular bdi?  If so, how would it do it.

That would be a tad involved I guess, but not impossible.

For block devices you'd need to get hold of the block device name, no
idea on how you would go about doing that from user-space, but I'm sure
its possible.

For nfs, /proc/mounts seems to contain the proper string. And I'm sure
FUSE has the right info somewhere to construct it as well.

> It seems to me after a fairly quick look that a bdi is always
> associated with a device number.  For block devices the device number
> is obvious.  For NFS and FUSE, the device number is an anon device
> number allocated at mount time.
> Maybe the name of the bdi should be based on that number.  Then it
> would be possible to map directly from e.g. a file to the bdi that the
> file would be written to. 

Sounds like a good idea, except that I don't find these numbers to be
very convenient to use. Currently ls /sys/class/bdi/ shows a human
interpretable list of names, and its rather clear what device is meant.
Using numbers would loose that.

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

      parent reply	other threads:[~2007-12-05 10:22 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-11-29 11:10 [patch 1/3] bdi patches Miklos Szeredi
2007-11-29 11:14 ` [patch 2/3] mm: bdi: allow to set a minimum to the bdi dirty limit Miklos Szeredi
2007-11-29 11:16 ` [patch 3/3] mm: bdi: allow to set a maximum " Miklos Szeredi
2007-11-30  0:52 ` [patch 1/3] bdi patches Neil Brown
2007-11-30  8:06   ` Miklos Szeredi
2007-11-30  8:36     ` Kay Sievers
2007-12-05 10:22   ` Peter Zijlstra [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1196850124.6788.22.camel@twins \
    --to=a.p.zijlstra@chello.nl \
    --cc=fengguang.wu@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=miklos@szeredi.hu \
    --cc=neilb@suse.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).