From: Shaohui Zheng on
On Sat, May 15, 2010 at 06:47:00PM +0530, Jaswinder Singh Rajput wrote:
> > + � � � if (hidden_num)
>
> if (hidden_num) is not required, as next line's for statement is also
> doing the same thing.

Good catching, We will remove this statement in the formal patch. Thanks Jaswinder.

Have a nice day.

>
> Thanks,
> --
> Jaswinder Singh.
>
> > + � � � � � � � for (i = 0; i < hidden_num; i++) {
> > + � � � � � � � � � � � int nid = num_nodes + i + 1;
> > + � � � � � � � � � � � node_set(nid, node_possible_map);
> > + � � � � � � � � � � � hidden_nodes[nid].start = hp_start + hp_size * i;
> > + � � � � � � � � � � � hidden_nodes[nid].end = hp_start + hp_size * (i+1);
> > + � � � � � � � � � � � node_set_hidden(nid);
> > + � � � � � � � }
> > +}

--
Thanks & Regards,
Shaohui

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo(a)vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
From: Shaohui Zheng on
On Thu, May 13, 2010 at 11:49:38AM -0700, Dave Hansen wrote:
> On Thu, 2010-05-13 at 11:15 -0700, Greg KH wrote:
> > > echo "physical_address=0x40000000 numa_node=3" > memory/probe
> > >
> > > I'd *GREATLY* prefer that over this new syntax. The existing mechanism
> > > is obtuse enough, and the ',3' makes it more so.
> > >
> > > We should have the code around to parse arguments like that, too, since
> > > we use it for the boot command-line.
> >
> > If you are going to be doing something like this, please use configfs,
> > that is what it is designed for, not sysfs.
>
> That's probably a really good point, especially since configfs didn't
> even exist when we made this 'probe' file thingy. It never was a great
> fit for sysfs anyway.
>
> -- Dave

the configfs was introduced in 2005, you can refer to http://lwn.net/Articles/148973/.

I enabled the configfs, and I see that the configfs is not so popular as we expected,
I mount configfs to /sys/kernel/config, I get an empty directory. It means that nobody is
using this file system, it is an interesting thing, is it means that configfs is deprecated?
If so, it might not be nessarry to develop a configfs interface for hotplug.

Dave & Greg,
Can you provide an exmample to use configfs as interface in Linux kernel, I want to get
a live demo, thanks.

--
Thanks & Regards,
Shaohui

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo(a)vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
From: Dave Hansen on
On Tue, 2010-05-18 at 13:41 +0800, Shaohui Zheng wrote:
> On Thu, May 13, 2010 at 11:49:38AM -0700, Dave Hansen wrote:
> the configfs was introduced in 2005, you can refer to http://lwn.net/Articles/148973/.
>
> I enabled the configfs, and I see that the configfs is not so popular as we expected,
> I mount configfs to /sys/kernel/config, I get an empty directory. It means that nobody is
> using this file system, it is an interesting thing, is it means that configfs is deprecated?
> If so, it might not be nessarry to develop a configfs interface for hotplug.

Uh, deprecated? What would make you think that? It does look like the
users are a we bit obscure, but that's a bit far from deprecated.

> Dave & Greg,
> Can you provide an exmample to use configfs as interface in Linux kernel, I want to get
> a live demo, thanks.

Heh. There are some great tools out there called cscope and grep. I
have them on my system and I bet you can get them on yours too.

That said, you're right. There don't seem to be a ton of users of it
these days. But, the LWN article you referenced also pointed to at
least one user. So, please try and put a wee bit of effort into it.

Maybe configfs isn't the way to go. I just think extending the 'probe'
file is a bad idea, especially in the way your patch did it. I'm open
to other alternatives. Since this is only for testing, perhaps debugfs
applies better. What other alternatives have you explored? How about a
Systemtap set to do it? :)

-- Dave

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo(a)vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
From: Nicholas A. Bellinger on
On Tue, 2010-05-18 at 13:41 +0800, Shaohui Zheng wrote:
> On Thu, May 13, 2010 at 11:49:38AM -0700, Dave Hansen wrote:
> > On Thu, 2010-05-13 at 11:15 -0700, Greg KH wrote:
> > > > echo "physical_address=0x40000000 numa_node=3" > memory/probe
> > > >
> > > > I'd *GREATLY* prefer that over this new syntax. The existing mechanism
> > > > is obtuse enough, and the ',3' makes it more so.
> > > >
> > > > We should have the code around to parse arguments like that, too, since
> > > > we use it for the boot command-line.
> > >
> > > If you are going to be doing something like this, please use configfs,
> > > that is what it is designed for, not sysfs.
> >
> > That's probably a really good point, especially since configfs didn't
> > even exist when we made this 'probe' file thingy. It never was a great
> > fit for sysfs anyway.
> >
> > -- Dave
>
> the configfs was introduced in 2005, you can refer to http://lwn.net/Articles/148973/.
>
> I enabled the configfs, and I see that the configfs is not so popular as we expected,
> I mount configfs to /sys/kernel/config, I get an empty directory. It means that nobody is
> using this file system, it is an interesting thing, is it means that configfs is deprecated?

Ohhhhhh, no. ConfigFS is the evolution of the original SysFS design to
to allow for kernel data structure configuration to be driven by
userspace syscalls in a number of very significant ways.

> If so, it might not be nessarry to develop a configfs interface for hotplug.
>

The usage of ConfigFS to provide a kernel <-> user configuration layout
really best depends on the protocol in question for particular data
structure state machine and parameter/attribute set. Using ConfigFS
involves Linux/VFS representing dependencies between data structures
both on a inter and intra kernel module context containing struct
config_groups driven by userspace mkdir(2) and link(2) syscall ops.

> Dave & Greg,
> Can you provide an exmample to use configfs as interface in Linux kernel, I want to get
> a live demo, thanks.

The TCM 4.0 design brings fabric module independent >= SPC-3 compatible
SCSI WWN target ports and a generic set of struct config_groups and CPP
macros to individual storage backstores using TCM target mode fabric
plugins across Linux/SCSI, Linux/BLOCK, and Linux/VFS subsystems. So
far, this has been implemented for SAS, FC, and iSCSI fabric protocols:

http://git.kernel.org/?p=linux/kernel/git/nab/lio-core-2.6.git;a=blob;f=drivers/target/target_core_configfs.c;hb=refs/heads/lio-4.0
http://git.kernel.org/?p=linux/kernel/git/nab/lio-core-2.6.git;a=blob;f=include/target/configfs_macros.h;hb=refs/heads/lio-4.0
http://git.kernel.org/?p=linux/kernel/git/nab/lio-core-2.6.git;a=blob;f=drivers/target/target_core_fabric_configfs.c;hb=refs/heads/lio-4.0
http://git.kernel.org/?p=linux/kernel/git/nab/lio-core-2.6.git;a=blob;f=include/target/target_core_fabric_configfs.h;hb=refs/heads/lio-4.0

http://git.kernel.org/?p=linux/kernel/git/nab/lio-core-2.6.git;a=blob;f=drivers/target/tcm_fc/tfc_conf.c;hb=refs/heads/lio-4.0
http://git.kernel.org/?p=linux/kernel/git/nab/lio-core-2.6.git;a=blob;f=drivers/target/tcm_loop/tcm_loop_configfs.c;hb=refs/heads/lio-4.0
http://git.kernel.org/?p=linux/kernel/git/nab/lio-core-2.6.git;a=blob;f=drivers/target/lio-target/iscsi_target_configfs.c;hb=refs/heads/lio-4.0

Best,

--nab

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo(a)vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
From: Paul Mundt on
On Tue, May 18, 2010 at 01:41:21PM +0800, Shaohui Zheng wrote:
> On Thu, May 13, 2010 at 11:49:38AM -0700, Dave Hansen wrote:
> > On Thu, 2010-05-13 at 11:15 -0700, Greg KH wrote:
> > > > echo "physical_address=0x40000000 numa_node=3" > memory/probe
> > > >
> > > > I'd *GREATLY* prefer that over this new syntax. The existing mechanism
> > > > is obtuse enough, and the ',3' makes it more so.
> > > >
> > > > We should have the code around to parse arguments like that, too, since
> > > > we use it for the boot command-line.
> > >
> > > If you are going to be doing something like this, please use configfs,
> > > that is what it is designed for, not sysfs.
> >
> > That's probably a really good point, especially since configfs didn't
> > even exist when we made this 'probe' file thingy. It never was a great
> > fit for sysfs anyway.
> >
> > -- Dave
>
> the configfs was introduced in 2005, you can refer to http://lwn.net/Articles/148973/.
>
> I enabled the configfs, and I see that the configfs is not so popular as we expected,
> I mount configfs to /sys/kernel/config, I get an empty directory. It means that nobody is
> using this file system, it is an interesting thing, is it means that configfs is deprecated?
> If so, it might not be nessarry to develop a configfs interface for hotplug.
>
configfs is certainly not deprecated, but there are also not that many
users of it at present. dlm/ocfs2 were the first users as far as I
recall, and netconsole as well. The fact you have an empty directory just
indicates that you don't have support for any of these enabled.

Note that there are also a lot of present-day sysfs and debugfs users
that could/should be converted to configfs but haven't quite gotten there
yet. In the sysfs case abuses are hard to rollback once they've made
become part of the ABI, but that's not grounds for continuing sysfs abuse
once cleaner methods become available. Many of the sysfs abuses were
implemented before configfs existed.

You can also find usage guidelines and example implementations in
Documentation/filesystems/configfs, which should give you a pretty good
idea of whether it's a good interface fit for your particular problem or
not.

These days sysfs seems to be the new procfs. It certainly helps to put a
bit of planning in to the interface before you're invariably stuck with
an ABI that's barely limping along.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo(a)vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/