Embedded Linux development
 help / color / mirror / Atom feed
* Intrusion detection system
From: Marco Stornelli @ 2008-08-05  8:51 UTC (permalink / raw)
  To: Linux-Embedded

Hi,

I have to design a network application on a board. I have to use an 
IDS/IPS system. Have you got any suggestions? Is there a good solution 
about an IDS system on embedded linux?

Thanks.

Regards,

-- 
Marco Stornelli
Embedded Software Engineer
CoRiTeL - Consorzio di Ricerca sulle Telecomunicazioni
http://www.coritel.it

marco.stornelli@coritel.it
+39 06 72582838

^ permalink raw reply

* Re: is it worth separating initrd from initramfs support?
From: Robert P. J. Day @ 2008-08-04 23:07 UTC (permalink / raw)
  To: Leon Woestenberg; +Cc: Embedded Linux mailing list
In-Reply-To: <c384c5ea0808041316v26ead859se5e778b074c735f4@mail.gmail.com>

On Mon, 4 Aug 2008, Leon Woestenberg wrote:

> Robert,
>
> On Mon, Aug 4, 2008 at 8:53 PM, Robert P. J. Day <rpjday@crashcourse.ca> wrote:
> >
> >  not sure if i asked this here once upon a time but, in the
> > current kernel, you get to select support for *both* initrd and
> > initramfs with a single selection (CONFIG_BLK_DEV_INITRD).
> >
> > ...
> >
> >  in the context of embedded linux, is there any value in
> > separating these features and letting one select them
> > individually?  isn't it
> >
> Makes sense to me to seperate them, especially if this reduces code
> size.
>
> Small kernels and initramfs's are used in memory constrained
> systems, we run it on FPGA SoC cores.
>
> Does disabling initrd alone reduce code size? Is the dependency on
> some subsystem removed (block i/o layer?)

i'm going to move this discussion to the kernel-newbies list since
it's really not tightly related to embedded, we'll hash it out there,
and i'll report back.  i'm *reasonably* convinced that we can save
some bytes here, but i'll make sure, then i'll let you know.

rday
--

========================================================================
Robert P. J. Day
Linux Consulting, Training and Annoying Kernel Pedantry:
    Have classroom, will lecture.

http://crashcourse.ca                          Waterloo, Ontario, CANADA
========================================================================

^ permalink raw reply

* Re: [patch 2/4] Configure out file locking features
From: Tim Bird @ 2008-08-04 22:32 UTC (permalink / raw)
  To: J. Bruce Fields
  Cc: Thomas Petazzoni, linux-kernel, linux-embedded, michael,
	Matt Mackall, matthew, linux-fsdevel, akpm
In-Reply-To: <20080804182532.GF25940@fieldses.org>

J. Bruce Fields wrote:
> On Mon, Aug 04, 2008 at 11:24:51AM -0700, Tim Bird wrote:
>> J. Bruce Fields wrote:
>>> On Mon, Aug 04, 2008 at 03:52:37PM +0200, Thomas Petazzoni wrote:
>>>> Le Sat, 2 Aug 2008 12:38:48 -0400,
>>>> "J. Bruce Fields" <bfields@fieldses.org> a écrit :
>>>>
>>>>> Out of curiosity, why does the nfs client need disabling, but not
>>>>> nfsd, gfs2, fuse, etc.?
>>>> Then also need disabling.
>>> OK by me, but again, why exactly?  Since you're replacing the locking
>>> calls they used by stubs that just return errors, in theory nfs, nfsd,
>>> gfs2, and the rest should still compile and run, just without locking
>>> support, right?
>> I think so, but haven't tested this myself.
>>
>> However, I would still be inclined to NOT add the extra config
>> dependencies.  Just my 2 cents.
> 
> OK.  My fear was that there was some good reason that the nfs dependency
> was added in the first place, and that it's since been lost....

For general information,  I just ran a test with the NFS dependency
on file locking turned off, and with the NFS auto-enable of
CONFIG_LOCKD removed.

It got me about a 16K savings, and I was able to successfully boot
a target with an NFS-mounted root file system.  I haven't run extensive
tests, so I don't know what apps might break in this configuration,
but at least in this test, it ran well enough to boot the machine.

Below is the patch I used, which is only provided for information.
This should NOT be applied - it consists of quick hacks to test this
configuration only (that is, to test NFS with CONFIG_FILE_LOCKING=n).

BTW - this is on a 2.6.23 kernel, so even the regular FILE_LOCKING
bits may be different from the current no-file-locking patch.

---
 fs/Kconfig         |    3 +--
 fs/nfs/client.c    |    6 ++++++
 fs/nfs/nfs3proc.c  |    4 ++++
 fs/nfs/proc.c      |    4 ++++
 fs/read_write.c    |    2 ++
 include/linux/fs.h |   13 +++++++------
 6 files changed, 24 insertions(+), 8 deletions(-)

--- a/fs/Kconfig
+++ b/fs/Kconfig
@@ -1701,8 +1701,7 @@ menu "Network File Systems"

 config NFS_FS
 	tristate "NFS file system support"
-	depends on INET && FILE_LOCKING
-	select LOCKD
+	depends on INET
 	select SUNRPC
 	select NFS_ACL_SUPPORT if NFS_V3_ACL
 	help
--- a/fs/nfs/client.c
+++ b/fs/nfs/client.c
@@ -414,6 +414,7 @@ static void nfs_destroy_server(struct nf
 		lockd_down();	/* release rpc.lockd */
 }

+#ifdef LOCKD
 /*
  * Version 2 or 3 lockd setup
  */
@@ -434,6 +435,7 @@ static int nfs_start_lockd(struct nfs_se
 out:
 	return error;
 }
+#endif

 /*
  * Initialise an NFSv3 ACL client connection
@@ -577,9 +579,11 @@ static int nfs_init_server(struct nfs_se
 	server->acdirmax = data->acdirmax * HZ;

 	/* Start lockd here, before we might error out */
+#ifdef LOCKD
 	error = nfs_start_lockd(server);
 	if (error < 0)
 		goto error;
+#endif

 	error = nfs_init_server_rpcclient(server, data->pseudoflavor);
 	if (error < 0)
@@ -1128,9 +1132,11 @@ struct nfs_server *nfs_clone_server(stru
 		(unsigned long long) server->fsid.major,
 		(unsigned long long) server->fsid.minor);

+#ifdef LOCKD
 	error = nfs_start_lockd(server);
 	if (error < 0)
 		goto out_free_server;
+#endif

 	spin_lock(&nfs_client_lock);
 	list_add_tail(&server->client_link, &server->nfs_client->cl_superblocks);
--- a/fs/nfs/nfs3proc.c
+++ b/fs/nfs/nfs3proc.c
@@ -795,7 +795,11 @@ static void nfs3_proc_commit_setup(struc
 static int
 nfs3_proc_lock(struct file *filp, int cmd, struct file_lock *fl)
 {
+#ifdef LOCKD
 	return nlmclnt_proc(filp->f_path.dentry->d_inode, cmd, fl);
+#else
+	return -ENOLCK;
+#endif
 }

 const struct nfs_rpc_ops nfs_v3_clientops = {
--- a/fs/nfs/proc.c
+++ b/fs/nfs/proc.c
@@ -605,7 +605,11 @@ nfs_proc_commit_setup(struct nfs_write_d
 static int
 nfs_proc_lock(struct file *filp, int cmd, struct file_lock *fl)
 {
+#ifdef LOCKD
 	return nlmclnt_proc(filp->f_path.dentry->d_inode, cmd, fl);
+#else
+	return -ENOLCK;
+#endif
 }


--- a/fs/read_write.c
+++ b/fs/read_write.c
@@ -211,6 +211,7 @@ int rw_verify_area(int read_write, struc
 	if (unlikely((pos < 0) || (loff_t) (pos + count) < 0))
 		goto Einval;

+#ifdef FILE_LOCKING
 	if (unlikely(inode->i_flock && MANDATORY_LOCK(inode))) {
 		int retval = locks_mandatory_area(
 			read_write == READ ? FLOCK_VERIFY_READ : FLOCK_VERIFY_WRITE,
@@ -218,6 +219,7 @@ int rw_verify_area(int read_write, struc
 		if (retval < 0)
 			return retval;
 	}
+#endif
 	return count > MAX_RW_COUNT ? MAX_RW_COUNT : count;

 Einval:
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -863,10 +863,6 @@ extern int fcntl_setlk64(unsigned int, s
 extern int fcntl_setlease(unsigned int fd, struct file *filp, long arg);
 extern int fcntl_getlease(struct file *filp);

-/* fs/sync.c */
-extern int do_sync_mapping_range(struct address_space *mapping, loff_t offset,
-			loff_t endbyte, unsigned int flags);
-
 /* fs/locks.c */
 extern void locks_init_lock(struct file_lock *);
 extern void locks_copy_lock(struct file_lock *, struct file_lock *);
@@ -918,6 +914,10 @@ extern int lock_may_write(struct inode *
 #define steal_locks(a)
 #endif /* !CONFIG_FILE_LOCKING */

+/* fs/sync.c */
+extern int do_sync_mapping_range(struct address_space *mapping, loff_t offset,
+			loff_t endbyte, unsigned int flags);
+
 struct fasync_struct {
 	int	magic;
 	int	fa_fd;
@@ -1424,8 +1424,6 @@ static inline int locks_verify_locked(st
 	return 0;
 }

-extern int rw_verify_area(int, struct file *, loff_t *, size_t);
-
 static inline int locks_verify_truncate(struct inode *inode,
 				    struct file *filp,
 				    loff_t size)
@@ -1459,6 +1457,9 @@ static inline int break_lease(struct ino

 #endif /* !CONFIG_FILE_LOCKING */

+extern int rw_verify_area(int, struct file *, loff_t *, size_t);
+
+
 /* fs/open.c */

 extern int do_truncate(struct dentry *, loff_t start, unsigned int time_attrs,



=============================
Tim Bird
Architecture Group Chair, CE Linux Forum
Senior Staff Engineer, Sony Corporation of America
=============================

^ permalink raw reply

* Re: is it worth separating initrd from initramfs support?
From: Robert P. J. Day @ 2008-08-04 20:29 UTC (permalink / raw)
  To: Leon Woestenberg; +Cc: Embedded Linux mailing list
In-Reply-To: <c384c5ea0808041316v26ead859se5e778b074c735f4@mail.gmail.com>

On Mon, 4 Aug 2008, Leon Woestenberg wrote:

> Robert,
>
> On Mon, Aug 4, 2008 at 8:53 PM, Robert P. J. Day <rpjday@crashcourse.ca> wrote:
> >
> >  not sure if i asked this here once upon a time but, in the
> > current kernel, you get to select support for *both* initrd and
> > initramfs with a single selection (CONFIG_BLK_DEV_INITRD).
> >
> > ...
> >
> >  in the context of embedded linux, is there any value in
> > separating these features and letting one select them
> > individually?  isn't it
> >
> Makes sense to me to seperate them, especially if this reduces code
> size.
>
> Small kernels and initramfs's are used in memory constrained
> systems, we run it on FPGA SoC cores.
>
> Does disabling initrd alone reduce code size? Is the dependency on
> some subsystem removed (block i/o layer?)

from a quick inspection, i *think* specifically disabling initrd
support would save a few bytes.  see the end of init/initramfs.c:

===========
static int __init populate_rootfs(void)
{
        char *err = unpack_to_rootfs(__initramfs_start,
                         __initramfs_end - __initramfs_start, 0);
        if (err)
                panic(err);
        if (initrd_start) {
#ifdef CONFIG_BLK_DEV_RAM
                int fd;
                printk(KERN_INFO "checking if image is initramfs...");
                err = unpack_to_rootfs((char *)initrd_start,
                        initrd_end - initrd_start, 1);
                if (!err) {
                        printk(" it is\n");
                        unpack_to_rootfs((char *)initrd_start,
                                initrd_end - initrd_start, 0);
                        free_initrd();
                        return 0;
                }
                printk("it isn't (%s); looks like an initrd\n", err);
                fd = sys_open("/initrd.image", O_WRONLY|O_CREAT, 0700);
                if (fd >= 0) {
                        sys_write(fd, (char *)initrd_start,
                                        initrd_end - initrd_start);
                        sys_close(fd);
                        free_initrd();
                }
#else
                printk(KERN_INFO "Unpacking initramfs...");
                err = unpack_to_rootfs((char *)initrd_start,
                        initrd_end - initrd_start, 0);
                if (err)
                        panic(err);
                printk(" done\n");
                free_initrd();
#endif
        }
        return 0;
}
==========

  if you're interested in *only* an internal intramfs, surely some of
the code above could be dropped, no?  but that's just my first
impression.

rday
--

========================================================================
Robert P. J. Day
Linux Consulting, Training and Annoying Kernel Pedantry:
    Have classroom, will lecture.

http://crashcourse.ca                          Waterloo, Ontario, CANADA
========================================================================

^ permalink raw reply

* Re: is it worth separating initrd from initramfs support?
From: Leon Woestenberg @ 2008-08-04 20:16 UTC (permalink / raw)
  To: Robert P. J. Day; +Cc: Embedded Linux mailing list
In-Reply-To: <alpine.LFD.1.10.0808041449420.9561@localhost.localdomain>

Robert,

On Mon, Aug 4, 2008 at 8:53 PM, Robert P. J. Day <rpjday@crashcourse.ca> wrote:
>
>  not sure if i asked this here once upon a time but, in the current
> kernel, you get to select support for *both* initrd and initramfs with
> a single selection (CONFIG_BLK_DEV_INITRD).
>
> ...
>
>  in the context of embedded linux, is there any value in separating
> these features and letting one select them individually?  isn't it
>
Makes sense to me to seperate them, especially if this reduces code size.

Small kernels and initramfs's are used in memory constrained systems,
we run it on FPGA SoC cores.

Does disabling initrd alone reduce code size? Is the dependency on
some subsystem removed (block i/o layer?)

Regards,
-- 
Leon

^ permalink raw reply

* Re: [patch 2/4] Configure out file locking features
From: J. Bruce Fields @ 2008-08-04 19:42 UTC (permalink / raw)
  To: Matt Mackall
  Cc: Tim Bird, Thomas Petazzoni, linux-kernel, linux-embedded, michael,
	matthew, linux-fsdevel, akpm
In-Reply-To: <1217876041.3657.119.camel@calx>

On Mon, Aug 04, 2008 at 01:54:01PM -0500, Matt Mackall wrote:
> 
> On Mon, 2008-08-04 at 14:25 -0400, J. Bruce Fields wrote:
> > On Mon, Aug 04, 2008 at 11:24:51AM -0700, Tim Bird wrote:
> > > J. Bruce Fields wrote:
> > > > On Mon, Aug 04, 2008 at 03:52:37PM +0200, Thomas Petazzoni wrote:
> > > >> Le Sat, 2 Aug 2008 12:38:48 -0400,
> > > >> "J. Bruce Fields" <bfields@fieldses.org> a écrit :
> > > >>
> > > >>> Out of curiosity, why does the nfs client need disabling, but not
> > > >>> nfsd, gfs2, fuse, etc.?
> > > >> Then also need disabling.
> > > > 
> > > > OK by me, but again, why exactly?  Since you're replacing the locking
> > > > calls they used by stubs that just return errors, in theory nfs, nfsd,
> > > > gfs2, and the rest should still compile and run, just without locking
> > > > support, right?
> > > 
> > > I think so, but haven't tested this myself.
> > > 
> > > However, I would still be inclined to NOT add the extra config
> > > dependencies.  Just my 2 cents.
> > 
> > OK.  My fear was that there was some good reason that the nfs dependency
> > was added in the first place, and that it's since been lost....
> 
> I vaguely remember there was some compile issue here, but that would
> have been back in the 2.6.10 era.

Sounds plausible.  I've got no objection to the patch either way, but if
we could at least just add a comment documenting the issue (if it
exists), that might be helpful.

--b.
--
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply

* Re: [patch 2/4] Configure out file locking features
From: Matt Mackall @ 2008-08-04 18:54 UTC (permalink / raw)
  To: J. Bruce Fields
  Cc: Tim Bird, Thomas Petazzoni, linux-kernel, linux-embedded, michael,
	matthew, linux-fsdevel, akpm
In-Reply-To: <20080804182532.GF25940@fieldses.org>


On Mon, 2008-08-04 at 14:25 -0400, J. Bruce Fields wrote:
> On Mon, Aug 04, 2008 at 11:24:51AM -0700, Tim Bird wrote:
> > J. Bruce Fields wrote:
> > > On Mon, Aug 04, 2008 at 03:52:37PM +0200, Thomas Petazzoni wrote:
> > >> Le Sat, 2 Aug 2008 12:38:48 -0400,
> > >> "J. Bruce Fields" <bfields@fieldses.org> a écrit :
> > >>
> > >>> Out of curiosity, why does the nfs client need disabling, but not
> > >>> nfsd, gfs2, fuse, etc.?
> > >> Then also need disabling.
> > > 
> > > OK by me, but again, why exactly?  Since you're replacing the locking
> > > calls they used by stubs that just return errors, in theory nfs, nfsd,
> > > gfs2, and the rest should still compile and run, just without locking
> > > support, right?
> > 
> > I think so, but haven't tested this myself.
> > 
> > However, I would still be inclined to NOT add the extra config
> > dependencies.  Just my 2 cents.
> 
> OK.  My fear was that there was some good reason that the nfs dependency
> was added in the first place, and that it's since been lost....

I vaguely remember there was some compile issue here, but that would
have been back in the 2.6.10 era.

-- 
Mathematics is the supreme nostalgia of our time.

^ permalink raw reply

* is it worth separating initrd from initramfs support?
From: Robert P. J. Day @ 2008-08-04 18:53 UTC (permalink / raw)
  To: Embedded Linux mailing list


  not sure if i asked this here once upon a time but, in the current
kernel, you get to select support for *both* initrd and initramfs with
a single selection (CONFIG_BLK_DEV_INITRD).

  however, folks who have been around a while generally associate the
feature INITRD with, well, an initrd image, while initramfs is
something a bit newer.

  in the context of embedded linux, is there any value in separating
these features and letting one select them individually?  isn't it
reasonable to think that one might need initramfs support but have
absolutely no use for "initrd" support?  or is that not worth worrying
about?

rday
--

========================================================================
Robert P. J. Day
Linux Consulting, Training and Annoying Kernel Pedantry:
    Have classroom, will lecture.

http://crashcourse.ca                          Waterloo, Ontario, CANADA
========================================================================

^ permalink raw reply

* Re: [patch 2/4] Configure out file locking features
From: J. Bruce Fields @ 2008-08-04 18:25 UTC (permalink / raw)
  To: Tim Bird
  Cc: Thomas Petazzoni, linux-kernel, linux-embedded, michael,
	Matt Mackall, matthew, linux-fsdevel, akpm
In-Reply-To: <48974973.6000408@am.sony.com>

On Mon, Aug 04, 2008 at 11:24:51AM -0700, Tim Bird wrote:
> J. Bruce Fields wrote:
> > On Mon, Aug 04, 2008 at 03:52:37PM +0200, Thomas Petazzoni wrote:
> >> Le Sat, 2 Aug 2008 12:38:48 -0400,
> >> "J. Bruce Fields" <bfields@fieldses.org> a écrit :
> >>
> >>> Out of curiosity, why does the nfs client need disabling, but not
> >>> nfsd, gfs2, fuse, etc.?
> >> Then also need disabling.
> > 
> > OK by me, but again, why exactly?  Since you're replacing the locking
> > calls they used by stubs that just return errors, in theory nfs, nfsd,
> > gfs2, and the rest should still compile and run, just without locking
> > support, right?
> 
> I think so, but haven't tested this myself.
> 
> However, I would still be inclined to NOT add the extra config
> dependencies.  Just my 2 cents.

OK.  My fear was that there was some good reason that the nfs dependency
was added in the first place, and that it's since been lost....

--b.
--
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply

* Re: [patch 2/4] Configure out file locking features
From: Tim Bird @ 2008-08-04 18:24 UTC (permalink / raw)
  To: J. Bruce Fields
  Cc: Thomas Petazzoni, linux-kernel, linux-embedded, michael,
	Matt Mackall, matthew, linux-fsdevel, akpm
In-Reply-To: <20080804181641.GE25940@fieldses.org>

J. Bruce Fields wrote:
> On Mon, Aug 04, 2008 at 03:52:37PM +0200, Thomas Petazzoni wrote:
>> Le Sat, 2 Aug 2008 12:38:48 -0400,
>> "J. Bruce Fields" <bfields@fieldses.org> a écrit :
>>
>>> Out of curiosity, why does the nfs client need disabling, but not
>>> nfsd, gfs2, fuse, etc.?
>> Then also need disabling.
> 
> OK by me, but again, why exactly?  Since you're replacing the locking
> calls they used by stubs that just return errors, in theory nfs, nfsd,
> gfs2, and the rest should still compile and run, just without locking
> support, right?

I think so, but haven't tested this myself.

However, I would still be inclined to NOT add the extra config
dependencies.  Just my 2 cents.
 -- Tim

=============================
Tim Bird
Architecture Group Chair, CE Linux Forum
Senior Staff Engineer, Sony Corporation of America
=============================

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

^ permalink raw reply

* Re: [PATCH] embedded: fix vc_translate operator precedence
From: Tim Bird @ 2008-08-04 18:18 UTC (permalink / raw)
  To: Geert Uytterhoeven; +Cc: linux-embedded, linux kernel
In-Reply-To: <Pine.LNX.4.64.0808041028230.31424@vixen.sonytel.be>

Geert Uytterhoeven wrote:
> 	Hi Tim,
> 
> On Fri, 1 Aug 2008, Tim Bird wrote:
>> This patch was copied to the e-mail list previously for testing.  Now,
>> all reports confirm that it works, so this is an official post for
>> application.
> 
> The above paragraph is not part of the patch description and should not end up
> in the git history, so it should be below the first `---' and above the
> diffstat, i.e.

Noted for future patch submissions.

Thanks,
 -- Tim

=============================
Tim Bird
Architecture Group Chair, CE Linux Forum
Senior Staff Engineer, Sony Corporation of America
=============================

^ permalink raw reply

* Re: [patch 2/4] Configure out file locking features
From: J. Bruce Fields @ 2008-08-04 18:16 UTC (permalink / raw)
  To: Thomas Petazzoni
  Cc: linux-kernel, linux-embedded, michael, Matt Mackall, matthew,
	linux-fsdevel, akpm
In-Reply-To: <20080804155237.1f64892d@surf>

On Mon, Aug 04, 2008 at 03:52:37PM +0200, Thomas Petazzoni wrote:
> Le Sat, 2 Aug 2008 12:38:48 -0400,
> "J. Bruce Fields" <bfields@fieldses.org> a écrit :
> 
> > Out of curiosity, why does the nfs client need disabling, but not
> > nfsd, gfs2, fuse, etc.?
> 
> Then also need disabling.

OK by me, but again, why exactly?  Since you're replacing the locking
calls they used by stubs that just return errors, in theory nfs, nfsd,
gfs2, and the rest should still compile and run, just without locking
support, right?

I don't have a strong opinion either way, just curious.

--b.

> Updated patch below.
> 
> Thanks!
> 
> Thomas
> 
> ---
> 
> Configure out file locking features
> 
> This patch adds the CONFIG_FILE_LOCKING option which allows to remove
> support for advisory locks. With this patch enabled, the flock()
> system call, the F_GETLK, F_SETLK and F_SETLKW operations of fcntl()
> and NFS support are disabled. These features are not necessarly needed
> on embedded systems. It allows to save ~11 Kb of kernel code and data:
> 
>    text	   data	    bss	    dec	    hex	filename
> 1125436	 118764	 212992	1457192	 163c28	vmlinux.old
> 1114299	 118564	 212992	1445855	 160fdf	vmlinux
>  -11137    -200       0  -11337   -2C49 +/-
> 
> This patch has originally been written by Matt Mackall
> <mpm@selenic.com>, and is part of the Linux Tiny project.
> 
> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
> Signed-off-by: Matt Mackall <mpm@selenic.com>
> Cc: matthew@wil.cx
> Cc: linux-fsdevel@vger.kernel.org
> Cc: mpm@selenic.com
> Cc: akpm@linux-foundation.org
> 
> ---
>  fs/Kconfig          |   15 ++++++++++++++-
>  fs/Makefile         |    3 ++-
>  fs/dlm/Kconfig      |    1 +
>  fs/gfs2/Kconfig     |    1 +
>  fs/proc/proc_misc.c |    4 ++++
>  include/linux/fs.h  |   52 +++++++++++++++++++++++++++++++++++++++++++++-------
>  kernel/sys_ni.c     |    1 +
>  kernel/sysctl.c     |    6 +++++-
>  8 files changed, 73 insertions(+), 10 deletions(-)
> 
> Index: linuxdev/fs/Kconfig
> ===================================================================
> --- linuxdev.orig/fs/Kconfig
> +++ linuxdev/fs/Kconfig
> @@ -427,12 +427,21 @@
>  	bool
>  	default n
>  
> +config FILE_LOCKING
> +	bool "Enable POSIX file locking API" if EMBEDDED
> +	default y
> +	help
> +	  This option enables standard file locking support, required
> +          for filesystems like NFS and for the flock() system
> +          call. Disabling this option saves about 11k.
> +
>  source "fs/xfs/Kconfig"
>  source "fs/gfs2/Kconfig"
>  
>  config OCFS2_FS
>  	tristate "OCFS2 file system support"
>  	depends on NET && SYSFS
> +	depends on FILE_LOCKING
>  	select CONFIGFS_FS
>  	select JBD
>  	select CRC32
> @@ -642,6 +651,7 @@
>  
>  config FUSE_FS
>  	tristate "Filesystem in Userspace support"
> +	depends on FILE_LOCKING
>  	help
>  	  With FUSE it is possible to implement a fully functional filesystem
>  	  in a userspace program.
> @@ -1567,7 +1577,7 @@
>  
>  config NFS_FS
>  	tristate "NFS client support"
> -	depends on INET
> +	depends on INET && FILE_LOCKING
>  	select LOCKD
>  	select SUNRPC
>  	select NFS_ACL_SUPPORT if NFS_V3_ACL
> @@ -1735,6 +1745,7 @@
>  
>  config LOCKD
>  	tristate
> +	depends on FILE_LOCKING
>  
>  config LOCKD_V4
>  	bool
> @@ -1870,6 +1881,7 @@
>  config CIFS
>  	tristate "CIFS support (advanced network filesystem, SMBFS successor)"
>  	depends on INET
> +	depends on FILE_LOCKING
>  	select NLS
>  	help
>  	  This is the client VFS module for the Common Internet File System
> @@ -2059,6 +2071,7 @@
>  config AFS_FS
>  	tristate "Andrew File System support (AFS) (EXPERIMENTAL)"
>  	depends on INET && EXPERIMENTAL
> +	depends on FILE_LOCKING
>  	select AF_RXRPC
>  	help
>  	  If you say Y here, you will get an experimental Andrew File System
> Index: linuxdev/fs/Makefile
> ===================================================================
> --- linuxdev.orig/fs/Makefile
> +++ linuxdev/fs/Makefile
> @@ -7,7 +7,7 @@
>  
>  obj-y :=	open.o read_write.o file_table.o super.o \
>  		char_dev.o stat.o exec.o pipe.o namei.o fcntl.o \
> -		ioctl.o readdir.o select.o fifo.o locks.o dcache.o inode.o \
> +		ioctl.o readdir.o select.o fifo.o dcache.o inode.o \
>  		attr.o bad_inode.o file.o filesystems.o namespace.o \
>  		seq_file.o xattr.o libfs.o fs-writeback.o \
>  		pnode.o drop_caches.o splice.o sync.o utimes.o \
> @@ -28,6 +28,7 @@
>  obj-$(CONFIG_TIMERFD)		+= timerfd.o
>  obj-$(CONFIG_EVENTFD)		+= eventfd.o
>  obj-$(CONFIG_AIO)               += aio.o
> +obj-$(CONFIG_FILE_LOCKING)      += locks.o
>  obj-$(CONFIG_COMPAT)		+= compat.o compat_ioctl.o
>  
>  nfsd-$(CONFIG_NFSD)		:= nfsctl.o
> Index: linuxdev/fs/dlm/Kconfig
> ===================================================================
> --- linuxdev.orig/fs/dlm/Kconfig
> +++ linuxdev/fs/dlm/Kconfig
> @@ -2,6 +2,7 @@
>  	tristate "Distributed Lock Manager (DLM)"
>  	depends on EXPERIMENTAL && INET
>  	depends on SYSFS && (IPV6 || IPV6=n)
> +	depends on FILE_LOCKING
>  	select CONFIGFS_FS
>  	select IP_SCTP
>  	help
> Index: linuxdev/fs/gfs2/Kconfig
> ===================================================================
> --- linuxdev.orig/fs/gfs2/Kconfig
> +++ linuxdev/fs/gfs2/Kconfig
> @@ -1,6 +1,7 @@
>  config GFS2_FS
>  	tristate "GFS2 file system support"
>  	depends on EXPERIMENTAL && (64BIT || (LSF && LBD))
> +	depends on FILE_LOCKING
>  	select FS_POSIX_ACL
>  	select CRC32
>  	help
> Index: linuxdev/fs/proc/proc_misc.c
> ===================================================================
> --- linuxdev.orig/fs/proc/proc_misc.c
> +++ linuxdev/fs/proc/proc_misc.c
> @@ -677,6 +677,7 @@
>  	return proc_calc_metrics(page, start, off, count, eof, len);
>  }
>  
> +#ifdef CONFIG_FILE_LOCKING
>  static int locks_open(struct inode *inode, struct file *filp)
>  {
>  	return seq_open(filp, &locks_seq_operations);
> @@ -688,6 +689,7 @@
>  	.llseek		= seq_lseek,
>  	.release	= seq_release,
>  };
> +#endif /* CONFIG_FILE_LOCKING */
>  
>  static int execdomains_read_proc(char *page, char **start, off_t off,
>  				 int count, int *eof, void *data)
> @@ -881,7 +883,9 @@
>  #ifdef CONFIG_PRINTK
>  	proc_create("kmsg", S_IRUSR, NULL, &proc_kmsg_operations);
>  #endif
> +#ifdef CONFIG_FILE_LOCKING
>  	proc_create("locks", 0, NULL, &proc_locks_operations);
> +#endif
>  	proc_create("devices", 0, NULL, &proc_devinfo_operations);
>  	proc_create("cpuinfo", 0, NULL, &proc_cpuinfo_operations);
>  #ifdef CONFIG_BLOCK
> Index: linuxdev/include/linux/fs.h
> ===================================================================
> --- linuxdev.orig/include/linux/fs.h
> +++ linuxdev/include/linux/fs.h
> @@ -983,6 +983,13 @@
>  
>  #include <linux/fcntl.h>
>  
> +extern void send_sigio(struct fown_struct *fown, int fd, int band);
> +
> +/* fs/sync.c */
> +extern int do_sync_mapping_range(struct address_space *mapping, loff_t offset,
> +			loff_t endbyte, unsigned int flags);
> +
> +#ifdef CONFIG_FILE_LOCKING
>  extern int fcntl_getlk(struct file *, struct flock __user *);
>  extern int fcntl_setlk(unsigned int, struct file *, unsigned int,
>  			struct flock __user *);
> @@ -993,14 +1000,9 @@
>  			struct flock64 __user *);
>  #endif
>  
> -extern void send_sigio(struct fown_struct *fown, int fd, int band);
>  extern int fcntl_setlease(unsigned int fd, struct file *filp, long arg);
>  extern int fcntl_getlease(struct file *filp);
>  
> -/* fs/sync.c */
> -extern int do_sync_mapping_range(struct address_space *mapping, loff_t offset,
> -			loff_t endbyte, unsigned int flags);
> -
>  /* fs/locks.c */
>  extern void locks_init_lock(struct file_lock *);
>  extern void locks_copy_lock(struct file_lock *, struct file_lock *);
> @@ -1023,6 +1025,33 @@
>  extern int lock_may_read(struct inode *, loff_t start, unsigned long count);
>  extern int lock_may_write(struct inode *, loff_t start, unsigned long count);
>  extern struct seq_operations locks_seq_operations;
> +#else /* !CONFIG_FILE_LOCKING */
> +#define fcntl_getlk(a, b) (-EINVAL)
> +#define fcntl_setlk(a, b, c, d) (-EACCES)
> +#if BITS_PER_LONG == 32
> +#define fcntl_getlk64(a, b) (-EINVAL)
> +#define fcntl_setlk64(a, b, c, d) (-EACCES)
> +#endif
> +#define fcntl_setlease(a, b, c) (0)
> +#define fcntl_getlease(a) (0)
> +#define locks_init_lock(a)
> +#define locks_copy_lock(a, b)
> +#define locks_remove_posix(a, b)
> +#define locks_remove_flock(a)
> +#define posix_test_lock(a, b) (0)
> +#define posix_lock_file(a, b) (-ENOLCK)
> +#define posix_lock_file_wait(a, b) (-ENOLCK)
> +#define posix_unblock_lock(a, b) (-ENOENT)
> +#define vfs_test_lock(a, b) (0)
> +#define vfs_lock_file(a, b, c, d) (-ENOLCK)
> +#define vfs_cancel_lock(a, b) (0)
> +#define flock_lock_file_wait(a, b) (-ENOLCK)
> +#define __break_lease(a, b) (0)
> +#define lease_get_mtime(a, b)
> +#define lock_may_read(a, b, c) (1)
> +#define lock_may_write(a, b, c) (1)
> +#endif /* !CONFIG_FILE_LOCKING */
> +
>  
>  struct fasync_struct {
>  	int	magic;
> @@ -1554,9 +1583,12 @@
>  /* /sys/fs */
>  extern struct kobject *fs_kobj;
>  
> +extern int rw_verify_area(int, struct file *, loff_t *, size_t);
> +
>  #define FLOCK_VERIFY_READ  1
>  #define FLOCK_VERIFY_WRITE 2
>  
> +#ifdef CONFIG_FILE_LOCKING
>  extern int locks_mandatory_locked(struct inode *);
>  extern int locks_mandatory_area(int, struct inode *, struct file *, loff_t, size_t);
>  
> @@ -1587,8 +1619,6 @@
>  	return 0;
>  }
>  
> -extern int rw_verify_area(int, struct file *, loff_t *, size_t);
> -
>  static inline int locks_verify_truncate(struct inode *inode,
>  				    struct file *filp,
>  				    loff_t size)
> @@ -1609,6 +1639,14 @@
>  		return __break_lease(inode, mode);
>  	return 0;
>  }
> +#else /* !CONFIG_FILE_LOCKING */
> +#define locks_mandatory_locked(a) (0)
> +#define locks_mandatory_area(a, b, c, d, e) (0)
> +#define mandatory_lock(a) (0)
> +#define locks_verify_locked(a) (0)
> +#define locks_verify_truncate(a, b, c) (0)
> +#define break_lease(a, b) (0)
> +#endif /* CONFIG_FILE_LOCKING */
>  
>  /* fs/open.c */
>  
> Index: linuxdev/kernel/sys_ni.c
> ===================================================================
> --- linuxdev.orig/kernel/sys_ni.c
> +++ linuxdev/kernel/sys_ni.c
> @@ -130,6 +130,7 @@
>  cond_syscall(sys_io_submit);
>  cond_syscall(sys_io_cancel);
>  cond_syscall(sys_io_getevents);
> +cond_syscall(sys_flock);
>  
>  /* arch-specific weak syscall entries */
>  cond_syscall(sys_pciconfig_read);
> Index: linuxdev/kernel/sysctl.c
> ===================================================================
> --- linuxdev.orig/kernel/sysctl.c
> +++ linuxdev/kernel/sysctl.c
> @@ -97,7 +97,7 @@
>  static int neg_one = -1;
>  #endif
>  
> -#ifdef CONFIG_MMU
> +#if defined(CONFIG_MMU) && defined(CONFIG_FILE_LOCKING)
>  static int two = 2;
>  #endif
>  
> @@ -1260,6 +1260,7 @@
>  		.extra1		= &minolduid,
>  		.extra2		= &maxolduid,
>  	},
> +#ifdef CONFIG_FILE_LOCKING
>  	{
>  		.ctl_name	= FS_LEASES,
>  		.procname	= "leases-enable",
> @@ -1268,6 +1269,7 @@
>  		.mode		= 0644,
>  		.proc_handler	= &proc_dointvec,
>  	},
> +#endif
>  #ifdef CONFIG_DNOTIFY
>  	{
>  		.ctl_name	= FS_DIR_NOTIFY,
> @@ -1279,6 +1281,7 @@
>  	},
>  #endif
>  #ifdef CONFIG_MMU
> +#ifdef CONFIG_FILE_LOCKING
>  	{
>  		.ctl_name	= FS_LEASE_TIME,
>  		.procname	= "lease-break-time",
> @@ -1290,6 +1293,7 @@
>  		.extra1		= &zero,
>  		.extra2		= &two,
>  	},
> +#endif /* CONFIG_FILE_LOCKING */
>  #ifdef CONFIG_AIO
>  	{
>  		.procname	= "aio-nr",
> 
> 
> -- 
> Thomas Petazzoni, Free Electrons
> Kernel, drivers and embedded Linux development,
> consulting, training and support.
> http://free-electrons.com
--
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply

* Re: [patch 4/4] Configure out IGMP support
From: David Woodhouse @ 2008-08-04 13:53 UTC (permalink / raw)
  To: Thomas Petazzoni
  Cc: linux-kernel, linux-embedded, michael, Matt Mackall, netdev,
	davem, akpm
In-Reply-To: <20080804144807.6b2374d9@surf>

On Mon, 2008-08-04 at 14:48 +0200, Thomas Petazzoni wrote:
> Le Fri, 01 Aug 2008 20:41:55 +0100,
> David Woodhouse <dwmw2@infradead.org> a écrit :
> 
> > The config option probably lives in net/Kconfig, not init/Kconfig.
> 
> Yes, it could. But AFAIK, until now, all CONFIG_EMBEDDED-related
> options have been put in init/Kconfig. But if it's preferred, I can of
> course change the patch to move the config option to net/Kconfig.

It clearly lives in net/Kconfig.

> > And please could you make it clear how this interacts with
> > IP_MULTICAST?
> > 
> > We already have a CONFIG_IP_MULTICAST option, for which the help text
> > says "For more people, it's safe to say N'. And I think it defaults to
> > that too. What more does CONFIG_IGMP remove? It's not made clear by
> > the help text.
> 
> The interaction of IGMP support with CONFIG_IP_MULTICAST is fairly
> unclear to me.
> 
> A large portion of igmp.c is already under #ifdef CONFIG_IP_MULTICAST:
> all the igmp_*() functions, amongst which is igmp_rcv(), referenced in
> igmp_protocol in net/ipv4/af_inet.c, which is compiled-out
> when !CONFIG_IP_MULTICAST.
> 
> All the proc-related code at the end of the file is only conditionnaly
> compiled on CONFIG_PROC_FS, but seems to in fact be only used if both
> CONFIG_IP_MULTICAST and CONFIG_PROC_FS are selected:
> igmp_mc_proc_init() in net/ipv4/ip_output.c is only called when
> CONFIG_IP_MULTICAST and CONFIG_PROC_FS are selected.
> 
> Besides that, it's unclear to me why the ip_mc_*() functions are useful
> when !CONFIG_IP_MULTICAST, but I'm probably missing something. 

Most of them aren't, as far as I can tell. 

> They are used to implement setsockopt-operations related to multicast,
> hooks for the routing code to handle multicast-related traffic, etc.

I wonder if those options should return errors now, rather than silently
failing but returning zero. Or maybe that _would_ cause a stock build of
ntpd to fail? Not that it really matters if it _does_, though.

It sounds like 'CONFIG_IGMP' is a bad name for the option, too -- and
the help text is similarly misleading. I think you need to work out how
it all fits together with CONFIG_IP_MULTICAST, fix it up, and resubmit
it.

-- 
David Woodhouse                            Open Source Technology Centre
David.Woodhouse@intel.com                              Intel Corporation



^ permalink raw reply

* Re: [patch 2/4] Configure out file locking features
From: Thomas Petazzoni @ 2008-08-04 13:52 UTC (permalink / raw)
  To: J. Bruce Fields
  Cc: linux-kernel, linux-embedded, michael, Matt Mackall, matthew,
	linux-fsdevel, akpm
In-Reply-To: <20080802163848.GB30454@fieldses.org>

Le Sat, 2 Aug 2008 12:38:48 -0400,
"J. Bruce Fields" <bfields@fieldses.org> a écrit :

> Out of curiosity, why does the nfs client need disabling, but not
> nfsd, gfs2, fuse, etc.?

Then also need disabling. Updated patch below.

Thanks!

Thomas

---

Configure out file locking features

This patch adds the CONFIG_FILE_LOCKING option which allows to remove
support for advisory locks. With this patch enabled, the flock()
system call, the F_GETLK, F_SETLK and F_SETLKW operations of fcntl()
and NFS support are disabled. These features are not necessarly needed
on embedded systems. It allows to save ~11 Kb of kernel code and data:

   text	   data	    bss	    dec	    hex	filename
1125436	 118764	 212992	1457192	 163c28	vmlinux.old
1114299	 118564	 212992	1445855	 160fdf	vmlinux
 -11137    -200       0  -11337   -2C49 +/-

This patch has originally been written by Matt Mackall
<mpm@selenic.com>, and is part of the Linux Tiny project.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: Matt Mackall <mpm@selenic.com>
Cc: matthew@wil.cx
Cc: linux-fsdevel@vger.kernel.org
Cc: mpm@selenic.com
Cc: akpm@linux-foundation.org

---
 fs/Kconfig          |   15 ++++++++++++++-
 fs/Makefile         |    3 ++-
 fs/dlm/Kconfig      |    1 +
 fs/gfs2/Kconfig     |    1 +
 fs/proc/proc_misc.c |    4 ++++
 include/linux/fs.h  |   52 +++++++++++++++++++++++++++++++++++++++++++++-------
 kernel/sys_ni.c     |    1 +
 kernel/sysctl.c     |    6 +++++-
 8 files changed, 73 insertions(+), 10 deletions(-)

Index: linuxdev/fs/Kconfig
===================================================================
--- linuxdev.orig/fs/Kconfig
+++ linuxdev/fs/Kconfig
@@ -427,12 +427,21 @@
 	bool
 	default n
 
+config FILE_LOCKING
+	bool "Enable POSIX file locking API" if EMBEDDED
+	default y
+	help
+	  This option enables standard file locking support, required
+          for filesystems like NFS and for the flock() system
+          call. Disabling this option saves about 11k.
+
 source "fs/xfs/Kconfig"
 source "fs/gfs2/Kconfig"
 
 config OCFS2_FS
 	tristate "OCFS2 file system support"
 	depends on NET && SYSFS
+	depends on FILE_LOCKING
 	select CONFIGFS_FS
 	select JBD
 	select CRC32
@@ -642,6 +651,7 @@
 
 config FUSE_FS
 	tristate "Filesystem in Userspace support"
+	depends on FILE_LOCKING
 	help
 	  With FUSE it is possible to implement a fully functional filesystem
 	  in a userspace program.
@@ -1567,7 +1577,7 @@
 
 config NFS_FS
 	tristate "NFS client support"
-	depends on INET
+	depends on INET && FILE_LOCKING
 	select LOCKD
 	select SUNRPC
 	select NFS_ACL_SUPPORT if NFS_V3_ACL
@@ -1735,6 +1745,7 @@
 
 config LOCKD
 	tristate
+	depends on FILE_LOCKING
 
 config LOCKD_V4
 	bool
@@ -1870,6 +1881,7 @@
 config CIFS
 	tristate "CIFS support (advanced network filesystem, SMBFS successor)"
 	depends on INET
+	depends on FILE_LOCKING
 	select NLS
 	help
 	  This is the client VFS module for the Common Internet File System
@@ -2059,6 +2071,7 @@
 config AFS_FS
 	tristate "Andrew File System support (AFS) (EXPERIMENTAL)"
 	depends on INET && EXPERIMENTAL
+	depends on FILE_LOCKING
 	select AF_RXRPC
 	help
 	  If you say Y here, you will get an experimental Andrew File System
Index: linuxdev/fs/Makefile
===================================================================
--- linuxdev.orig/fs/Makefile
+++ linuxdev/fs/Makefile
@@ -7,7 +7,7 @@
 
 obj-y :=	open.o read_write.o file_table.o super.o \
 		char_dev.o stat.o exec.o pipe.o namei.o fcntl.o \
-		ioctl.o readdir.o select.o fifo.o locks.o dcache.o inode.o \
+		ioctl.o readdir.o select.o fifo.o dcache.o inode.o \
 		attr.o bad_inode.o file.o filesystems.o namespace.o \
 		seq_file.o xattr.o libfs.o fs-writeback.o \
 		pnode.o drop_caches.o splice.o sync.o utimes.o \
@@ -28,6 +28,7 @@
 obj-$(CONFIG_TIMERFD)		+= timerfd.o
 obj-$(CONFIG_EVENTFD)		+= eventfd.o
 obj-$(CONFIG_AIO)               += aio.o
+obj-$(CONFIG_FILE_LOCKING)      += locks.o
 obj-$(CONFIG_COMPAT)		+= compat.o compat_ioctl.o
 
 nfsd-$(CONFIG_NFSD)		:= nfsctl.o
Index: linuxdev/fs/dlm/Kconfig
===================================================================
--- linuxdev.orig/fs/dlm/Kconfig
+++ linuxdev/fs/dlm/Kconfig
@@ -2,6 +2,7 @@
 	tristate "Distributed Lock Manager (DLM)"
 	depends on EXPERIMENTAL && INET
 	depends on SYSFS && (IPV6 || IPV6=n)
+	depends on FILE_LOCKING
 	select CONFIGFS_FS
 	select IP_SCTP
 	help
Index: linuxdev/fs/gfs2/Kconfig
===================================================================
--- linuxdev.orig/fs/gfs2/Kconfig
+++ linuxdev/fs/gfs2/Kconfig
@@ -1,6 +1,7 @@
 config GFS2_FS
 	tristate "GFS2 file system support"
 	depends on EXPERIMENTAL && (64BIT || (LSF && LBD))
+	depends on FILE_LOCKING
 	select FS_POSIX_ACL
 	select CRC32
 	help
Index: linuxdev/fs/proc/proc_misc.c
===================================================================
--- linuxdev.orig/fs/proc/proc_misc.c
+++ linuxdev/fs/proc/proc_misc.c
@@ -677,6 +677,7 @@
 	return proc_calc_metrics(page, start, off, count, eof, len);
 }
 
+#ifdef CONFIG_FILE_LOCKING
 static int locks_open(struct inode *inode, struct file *filp)
 {
 	return seq_open(filp, &locks_seq_operations);
@@ -688,6 +689,7 @@
 	.llseek		= seq_lseek,
 	.release	= seq_release,
 };
+#endif /* CONFIG_FILE_LOCKING */
 
 static int execdomains_read_proc(char *page, char **start, off_t off,
 				 int count, int *eof, void *data)
@@ -881,7 +883,9 @@
 #ifdef CONFIG_PRINTK
 	proc_create("kmsg", S_IRUSR, NULL, &proc_kmsg_operations);
 #endif
+#ifdef CONFIG_FILE_LOCKING
 	proc_create("locks", 0, NULL, &proc_locks_operations);
+#endif
 	proc_create("devices", 0, NULL, &proc_devinfo_operations);
 	proc_create("cpuinfo", 0, NULL, &proc_cpuinfo_operations);
 #ifdef CONFIG_BLOCK
Index: linuxdev/include/linux/fs.h
===================================================================
--- linuxdev.orig/include/linux/fs.h
+++ linuxdev/include/linux/fs.h
@@ -983,6 +983,13 @@
 
 #include <linux/fcntl.h>
 
+extern void send_sigio(struct fown_struct *fown, int fd, int band);
+
+/* fs/sync.c */
+extern int do_sync_mapping_range(struct address_space *mapping, loff_t offset,
+			loff_t endbyte, unsigned int flags);
+
+#ifdef CONFIG_FILE_LOCKING
 extern int fcntl_getlk(struct file *, struct flock __user *);
 extern int fcntl_setlk(unsigned int, struct file *, unsigned int,
 			struct flock __user *);
@@ -993,14 +1000,9 @@
 			struct flock64 __user *);
 #endif
 
-extern void send_sigio(struct fown_struct *fown, int fd, int band);
 extern int fcntl_setlease(unsigned int fd, struct file *filp, long arg);
 extern int fcntl_getlease(struct file *filp);
 
-/* fs/sync.c */
-extern int do_sync_mapping_range(struct address_space *mapping, loff_t offset,
-			loff_t endbyte, unsigned int flags);
-
 /* fs/locks.c */
 extern void locks_init_lock(struct file_lock *);
 extern void locks_copy_lock(struct file_lock *, struct file_lock *);
@@ -1023,6 +1025,33 @@
 extern int lock_may_read(struct inode *, loff_t start, unsigned long count);
 extern int lock_may_write(struct inode *, loff_t start, unsigned long count);
 extern struct seq_operations locks_seq_operations;
+#else /* !CONFIG_FILE_LOCKING */
+#define fcntl_getlk(a, b) (-EINVAL)
+#define fcntl_setlk(a, b, c, d) (-EACCES)
+#if BITS_PER_LONG == 32
+#define fcntl_getlk64(a, b) (-EINVAL)
+#define fcntl_setlk64(a, b, c, d) (-EACCES)
+#endif
+#define fcntl_setlease(a, b, c) (0)
+#define fcntl_getlease(a) (0)
+#define locks_init_lock(a)
+#define locks_copy_lock(a, b)
+#define locks_remove_posix(a, b)
+#define locks_remove_flock(a)
+#define posix_test_lock(a, b) (0)
+#define posix_lock_file(a, b) (-ENOLCK)
+#define posix_lock_file_wait(a, b) (-ENOLCK)
+#define posix_unblock_lock(a, b) (-ENOENT)
+#define vfs_test_lock(a, b) (0)
+#define vfs_lock_file(a, b, c, d) (-ENOLCK)
+#define vfs_cancel_lock(a, b) (0)
+#define flock_lock_file_wait(a, b) (-ENOLCK)
+#define __break_lease(a, b) (0)
+#define lease_get_mtime(a, b)
+#define lock_may_read(a, b, c) (1)
+#define lock_may_write(a, b, c) (1)
+#endif /* !CONFIG_FILE_LOCKING */
+
 
 struct fasync_struct {
 	int	magic;
@@ -1554,9 +1583,12 @@
 /* /sys/fs */
 extern struct kobject *fs_kobj;
 
+extern int rw_verify_area(int, struct file *, loff_t *, size_t);
+
 #define FLOCK_VERIFY_READ  1
 #define FLOCK_VERIFY_WRITE 2
 
+#ifdef CONFIG_FILE_LOCKING
 extern int locks_mandatory_locked(struct inode *);
 extern int locks_mandatory_area(int, struct inode *, struct file *, loff_t, size_t);
 
@@ -1587,8 +1619,6 @@
 	return 0;
 }
 
-extern int rw_verify_area(int, struct file *, loff_t *, size_t);
-
 static inline int locks_verify_truncate(struct inode *inode,
 				    struct file *filp,
 				    loff_t size)
@@ -1609,6 +1639,14 @@
 		return __break_lease(inode, mode);
 	return 0;
 }
+#else /* !CONFIG_FILE_LOCKING */
+#define locks_mandatory_locked(a) (0)
+#define locks_mandatory_area(a, b, c, d, e) (0)
+#define mandatory_lock(a) (0)
+#define locks_verify_locked(a) (0)
+#define locks_verify_truncate(a, b, c) (0)
+#define break_lease(a, b) (0)
+#endif /* CONFIG_FILE_LOCKING */
 
 /* fs/open.c */
 
Index: linuxdev/kernel/sys_ni.c
===================================================================
--- linuxdev.orig/kernel/sys_ni.c
+++ linuxdev/kernel/sys_ni.c
@@ -130,6 +130,7 @@
 cond_syscall(sys_io_submit);
 cond_syscall(sys_io_cancel);
 cond_syscall(sys_io_getevents);
+cond_syscall(sys_flock);
 
 /* arch-specific weak syscall entries */
 cond_syscall(sys_pciconfig_read);
Index: linuxdev/kernel/sysctl.c
===================================================================
--- linuxdev.orig/kernel/sysctl.c
+++ linuxdev/kernel/sysctl.c
@@ -97,7 +97,7 @@
 static int neg_one = -1;
 #endif
 
-#ifdef CONFIG_MMU
+#if defined(CONFIG_MMU) && defined(CONFIG_FILE_LOCKING)
 static int two = 2;
 #endif
 
@@ -1260,6 +1260,7 @@
 		.extra1		= &minolduid,
 		.extra2		= &maxolduid,
 	},
+#ifdef CONFIG_FILE_LOCKING
 	{
 		.ctl_name	= FS_LEASES,
 		.procname	= "leases-enable",
@@ -1268,6 +1269,7 @@
 		.mode		= 0644,
 		.proc_handler	= &proc_dointvec,
 	},
+#endif
 #ifdef CONFIG_DNOTIFY
 	{
 		.ctl_name	= FS_DIR_NOTIFY,
@@ -1279,6 +1281,7 @@
 	},
 #endif
 #ifdef CONFIG_MMU
+#ifdef CONFIG_FILE_LOCKING
 	{
 		.ctl_name	= FS_LEASE_TIME,
 		.procname	= "lease-break-time",
@@ -1290,6 +1293,7 @@
 		.extra1		= &zero,
 		.extra2		= &two,
 	},
+#endif /* CONFIG_FILE_LOCKING */
 #ifdef CONFIG_AIO
 	{
 		.procname	= "aio-nr",


-- 
Thomas Petazzoni, Free Electrons
Kernel, drivers and embedded Linux development,
consulting, training and support.
http://free-electrons.com

^ permalink raw reply

* Re: [patch 4/4] Configure out IGMP support
From: Adrian Bunk @ 2008-08-04 12:53 UTC (permalink / raw)
  To: Thomas Petazzoni
  Cc: David Woodhouse, linux-kernel, linux-embedded, michael,
	Matt Mackall, netdev, davem, akpm
In-Reply-To: <20080804144807.6b2374d9@surf>

On Mon, Aug 04, 2008 at 02:48:07PM +0200, Thomas Petazzoni wrote:
> Le Fri, 01 Aug 2008 20:41:55 +0100,
> David Woodhouse <dwmw2@infradead.org> a écrit :
> 
> > The config option probably lives in net/Kconfig, not init/Kconfig.
> 
> Yes, it could. But AFAIK, until now, all CONFIG_EMBEDDED-related
> options have been put in init/Kconfig.
>...

No, the vast majority is actually outside of init/Kconfig.

> Sincerly,
> 
> Thomas

cu
Adrian

-- 

       "Is there not promise of rain?" Ling Tan asked suddenly out
        of the darkness. There had been need of rain for many days.
       "Only a promise," Lao Er said.
                                       Pearl S. Buck - Dragon Seed

^ permalink raw reply

* Re: [patch 4/4] Configure out IGMP support
From: Thomas Petazzoni @ 2008-08-04 12:48 UTC (permalink / raw)
  To: David Woodhouse
  Cc: linux-kernel, linux-embedded, michael, Matt Mackall, netdev,
	davem, akpm
In-Reply-To: <1217619715.3454.488.camel@pmac.infradead.org>

Le Fri, 01 Aug 2008 20:41:55 +0100,
David Woodhouse <dwmw2@infradead.org> a écrit :

> The config option probably lives in net/Kconfig, not init/Kconfig.

Yes, it could. But AFAIK, until now, all CONFIG_EMBEDDED-related
options have been put in init/Kconfig. But if it's preferred, I can of
course change the patch to move the config option to net/Kconfig.

> And please could you make it clear how this interacts with
> IP_MULTICAST?
> 
> We already have a CONFIG_IP_MULTICAST option, for which the help text
> says "For more people, it's safe to say N'. And I think it defaults to
> that too. What more does CONFIG_IGMP remove? It's not made clear by
> the help text.

The interaction of IGMP support with CONFIG_IP_MULTICAST is fairly
unclear to me.

A large portion of igmp.c is already under #ifdef CONFIG_IP_MULTICAST:
all the igmp_*() functions, amongst which is igmp_rcv(), referenced in
igmp_protocol in net/ipv4/af_inet.c, which is compiled-out
when !CONFIG_IP_MULTICAST.

All the proc-related code at the end of the file is only conditionnaly
compiled on CONFIG_PROC_FS, but seems to in fact be only used if both
CONFIG_IP_MULTICAST and CONFIG_PROC_FS are selected:
igmp_mc_proc_init() in net/ipv4/ip_output.c is only called when
CONFIG_IP_MULTICAST and CONFIG_PROC_FS are selected.

Besides that, it's unclear to me why the ip_mc_*() functions are useful
when !CONFIG_IP_MULTICAST, but I'm probably missing something. They are
used to implement setsockopt-operations related to multicast, hooks for
the routing code to handle multicast-related traffic, etc.

Sincerly,

Thomas
-- 
Thomas Petazzoni, Free Electrons
Kernel, drivers and embedded Linux development,
consulting, training and support.
http://free-electrons.com

^ permalink raw reply

* Re: [PATCH] embedded: fix vc_translate operator precedence
From: Geert Uytterhoeven @ 2008-08-04  8:33 UTC (permalink / raw)
  To: David Woodhouse; +Cc: Tim Bird, linux-embedded, linux kernel
In-Reply-To: <1217838685.3454.564.camel@pmac.infradead.org>

[-- Attachment #1: Type: TEXT/PLAIN, Size: 812 bytes --]

On Mon, 4 Aug 2008, David Woodhouse wrote:
> On Mon, 2008-08-04 at 10:29 +0200, Geert Uytterhoeven wrote:
> > The above paragraph is not part of the patch description and should
> > not end up in the git history, so it should be below the first `---'
> > and above the diffstat, i.e.
> 
> Since it reports successful testing, I figured I might as well keep it.

... unlike all other patches you take? ;-)

With kind regards,

Geert Uytterhoeven
Software Architect

Sony Techsoft Centre Europe
The Corporate Village · Da Vincilaan 7-D1 · B-1935 Zaventem · Belgium

Phone:    +32 (0)2 700 8453
Fax:      +32 (0)2 700 8622
E-mail:   Geert.Uytterhoeven@sonycom.com
Internet: http://www.sony-europe.com/

A division of Sony Europe (Belgium) N.V.
VAT BE 0413.825.160 · RPR Brussels
Fortis 293-0376800-10 GEBA-BE-BB

^ permalink raw reply

* Re: [PATCH] embedded: fix vc_translate operator precedence
From: David Woodhouse @ 2008-08-04  8:31 UTC (permalink / raw)
  To: Geert Uytterhoeven; +Cc: Tim Bird, linux-embedded, linux kernel
In-Reply-To: <Pine.LNX.4.64.0808041028230.31424@vixen.sonytel.be>

On Mon, 2008-08-04 at 10:29 +0200, Geert Uytterhoeven wrote:
> The above paragraph is not part of the patch description and should
> not end up in the git history, so it should be below the first `---'
> and above the diffstat, i.e.

Since it reports successful testing, I figured I might as well keep it.

-- 
dwmw2

^ permalink raw reply

* Re: [PATCH] embedded: fix vc_translate operator precedence
From: Geert Uytterhoeven @ 2008-08-04  8:29 UTC (permalink / raw)
  To: Tim Bird; +Cc: linux-embedded, linux kernel
In-Reply-To: <48937AAE.5070407@am.sony.com>

[-- Attachment #1: Type: TEXT/PLAIN, Size: 917 bytes --]

	Hi Tim,

On Fri, 1 Aug 2008, Tim Bird wrote:
> This patch was copied to the e-mail list previously for testing.  Now,
> all reports confirm that it works, so this is an official post for
> application.

The above paragraph is not part of the patch description and should not end up
in the git history, so it should be below the first `---' and above the
diffstat, i.e.

> Signed-off-by: Tim Bird <tim.bird@am.sony.com>
> ---

---> here

>  vt_kern.h |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

With kind regards,

Geert Uytterhoeven
Software Architect

Sony Techsoft Centre Europe
The Corporate Village · Da Vincilaan 7-D1 · B-1935 Zaventem · Belgium

Phone:    +32 (0)2 700 8453
Fax:      +32 (0)2 700 8622
E-mail:   Geert.Uytterhoeven@sonycom.com
Internet: http://www.sony-europe.com/

A division of Sony Europe (Belgium) N.V.
VAT BE 0413.825.160 · RPR Brussels
Fortis 293-0376800-10 GEBA-BE-BB

^ permalink raw reply

* Re: [patch 2/4] Configure out file locking features
From: J. Bruce Fields @ 2008-08-02 16:38 UTC (permalink / raw)
  To: Thomas Petazzoni
  Cc: linux-kernel, linux-embedded, michael, Matt Mackall, matthew,
	linux-fsdevel, akpm
In-Reply-To: <20080731093220.969460336@free-electrons.com>

On Thu, Jul 31, 2008 at 11:27:05AM +0200, Thomas Petazzoni wrote:
> This patch adds the CONFIG_FILE_LOCKING option which allows to remove
> support for advisory locks. With this patch enabled, the flock()
> system call, the F_GETLK, F_SETLK and F_SETLKW operations of fcntl()
> and NFS support are disabled. These features are not necessarly needed
> on embedded systems. It allows to save ~11 Kb of kernel code and data:

Out of curiosity, why does the nfs client need disabling, but not nfsd,
gfs2, fuse, etc.?

--b.

> 
>    text	   data	    bss	    dec	    hex	filename
> 1125436	 118764	 212992	1457192	 163c28	vmlinux.old
> 1114299	 118564	 212992	1445855	 160fdf	vmlinux
>  -11137    -200       0  -11337   -2C49 +/-
> 
> This patch has originally been written by Matt Mackall
> <mpm@selenic.com>, and is part of the Linux Tiny project.
> 
> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
> Signed-off-by: Matt Mackall <mpm@selenic.com>
> Cc: matthew@wil.cx
> Cc: linux-fsdevel@vger.kernel.org
> Cc: mpm@selenic.com
> Cc: akpm@linux-foundation.org
> 
> ---
>  fs/Kconfig          |    2 +-
>  fs/Makefile         |    3 ++-
>  fs/proc/proc_misc.c |    4 ++++
>  include/linux/fs.h  |   52 +++++++++++++++++++++++++++++++++++++++++++++-------
>  init/Kconfig        |    8 ++++++++
>  kernel/sys_ni.c     |    1 +
>  kernel/sysctl.c     |    6 +++++-
>  7 files changed, 66 insertions(+), 10 deletions(-)
> 
> Index: linuxdev/fs/Kconfig
> ===================================================================
> --- linuxdev.orig/fs/Kconfig
> +++ linuxdev/fs/Kconfig
> @@ -1559,7 +1559,7 @@
>  
>  config NFS_FS
>  	tristate "NFS client support"
> -	depends on INET
> +	depends on INET && FILE_LOCKING
>  	select LOCKD
>  	select SUNRPC
>  	select NFS_ACL_SUPPORT if NFS_V3_ACL
> Index: linuxdev/fs/Makefile
> ===================================================================
> --- linuxdev.orig/fs/Makefile
> +++ linuxdev/fs/Makefile
> @@ -7,7 +7,7 @@
>  
>  obj-y :=	open.o read_write.o file_table.o super.o \
>  		char_dev.o stat.o exec.o pipe.o namei.o fcntl.o \
> -		ioctl.o readdir.o select.o fifo.o locks.o dcache.o inode.o \
> +		ioctl.o readdir.o select.o fifo.o dcache.o inode.o \
>  		attr.o bad_inode.o file.o filesystems.o namespace.o \
>  		seq_file.o xattr.o libfs.o fs-writeback.o \
>  		pnode.o drop_caches.o splice.o sync.o utimes.o \
> @@ -28,6 +28,7 @@
>  obj-$(CONFIG_TIMERFD)		+= timerfd.o
>  obj-$(CONFIG_EVENTFD)		+= eventfd.o
>  obj-$(CONFIG_AIO)               += aio.o
> +obj-$(CONFIG_FILE_LOCKING)      += locks.o
>  obj-$(CONFIG_COMPAT)		+= compat.o compat_ioctl.o
>  
>  nfsd-$(CONFIG_NFSD)		:= nfsctl.o
> Index: linuxdev/fs/proc/proc_misc.c
> ===================================================================
> --- linuxdev.orig/fs/proc/proc_misc.c
> +++ linuxdev/fs/proc/proc_misc.c
> @@ -677,6 +677,7 @@
>  	return proc_calc_metrics(page, start, off, count, eof, len);
>  }
>  
> +#ifdef CONFIG_FILE_LOCKING
>  static int locks_open(struct inode *inode, struct file *filp)
>  {
>  	return seq_open(filp, &locks_seq_operations);
> @@ -688,6 +689,7 @@
>  	.llseek		= seq_lseek,
>  	.release	= seq_release,
>  };
> +#endif /* CONFIG_FILE_LOCKING */
>  
>  static int execdomains_read_proc(char *page, char **start, off_t off,
>  				 int count, int *eof, void *data)
> @@ -881,7 +883,9 @@
>  #ifdef CONFIG_PRINTK
>  	proc_create("kmsg", S_IRUSR, NULL, &proc_kmsg_operations);
>  #endif
> +#ifdef CONFIG_FILE_LOCKING
>  	proc_create("locks", 0, NULL, &proc_locks_operations);
> +#endif
>  	proc_create("devices", 0, NULL, &proc_devinfo_operations);
>  	proc_create("cpuinfo", 0, NULL, &proc_cpuinfo_operations);
>  #ifdef CONFIG_BLOCK
> Index: linuxdev/include/linux/fs.h
> ===================================================================
> --- linuxdev.orig/include/linux/fs.h
> +++ linuxdev/include/linux/fs.h
> @@ -983,6 +983,13 @@
>  
>  #include <linux/fcntl.h>
>  
> +extern void send_sigio(struct fown_struct *fown, int fd, int band);
> +
> +/* fs/sync.c */
> +extern int do_sync_mapping_range(struct address_space *mapping, loff_t offset,
> +			loff_t endbyte, unsigned int flags);
> +
> +#ifdef CONFIG_FILE_LOCKING
>  extern int fcntl_getlk(struct file *, struct flock __user *);
>  extern int fcntl_setlk(unsigned int, struct file *, unsigned int,
>  			struct flock __user *);
> @@ -993,14 +1000,9 @@
>  			struct flock64 __user *);
>  #endif
>  
> -extern void send_sigio(struct fown_struct *fown, int fd, int band);
>  extern int fcntl_setlease(unsigned int fd, struct file *filp, long arg);
>  extern int fcntl_getlease(struct file *filp);
>  
> -/* fs/sync.c */
> -extern int do_sync_mapping_range(struct address_space *mapping, loff_t offset,
> -			loff_t endbyte, unsigned int flags);
> -
>  /* fs/locks.c */
>  extern void locks_init_lock(struct file_lock *);
>  extern void locks_copy_lock(struct file_lock *, struct file_lock *);
> @@ -1023,6 +1025,33 @@
>  extern int lock_may_read(struct inode *, loff_t start, unsigned long count);
>  extern int lock_may_write(struct inode *, loff_t start, unsigned long count);
>  extern struct seq_operations locks_seq_operations;
> +#else /* !CONFIG_FILE_LOCKING */
> +#define fcntl_getlk(a, b) (-EINVAL)
> +#define fcntl_setlk(a, b, c, d) (-EACCES)
> +#if BITS_PER_LONG == 32
> +#define fcntl_getlk64(a, b) (-EINVAL)
> +#define fcntl_setlk64(a, b, c, d) (-EACCES)
> +#endif
> +#define fcntl_setlease(a, b, c) (0)
> +#define fcntl_getlease(a) (0)
> +#define locks_init_lock(a)
> +#define locks_copy_lock(a, b)
> +#define locks_remove_posix(a, b)
> +#define locks_remove_flock(a)
> +#define posix_test_lock(a, b) (0)
> +#define posix_lock_file(a, b) (-ENOLCK)
> +#define posix_lock_file_wait(a, b) (-ENOLCK)
> +#define posix_unblock_lock(a, b) (-ENOENT)
> +#define vfs_test_lock(a, b) (0)
> +#define vfs_lock_file(a, b, c, d) (-ENOLCK)
> +#define vfs_cancel_lock(a, b) (0)
> +#define flock_lock_file_wait(a, b) (-ENOLCK)
> +#define __break_lease(a, b) (0)
> +#define lease_get_mtime(a, b)
> +#define lock_may_read(a, b, c) (1)
> +#define lock_may_write(a, b, c) (1)
> +#endif /* !CONFIG_FILE_LOCKING */
> +
>  
>  struct fasync_struct {
>  	int	magic;
> @@ -1554,9 +1583,12 @@
>  /* /sys/fs */
>  extern struct kobject *fs_kobj;
>  
> +extern int rw_verify_area(int, struct file *, loff_t *, size_t);
> +
>  #define FLOCK_VERIFY_READ  1
>  #define FLOCK_VERIFY_WRITE 2
>  
> +#ifdef CONFIG_FILE_LOCKING
>  extern int locks_mandatory_locked(struct inode *);
>  extern int locks_mandatory_area(int, struct inode *, struct file *, loff_t, size_t);
>  
> @@ -1587,8 +1619,6 @@
>  	return 0;
>  }
>  
> -extern int rw_verify_area(int, struct file *, loff_t *, size_t);
> -
>  static inline int locks_verify_truncate(struct inode *inode,
>  				    struct file *filp,
>  				    loff_t size)
> @@ -1609,6 +1639,14 @@
>  		return __break_lease(inode, mode);
>  	return 0;
>  }
> +#else /* !CONFIG_FILE_LOCKING */
> +#define locks_mandatory_locked(a) (0)
> +#define locks_mandatory_area(a, b, c, d, e) (0)
> +#define mandatory_lock(a) (0)
> +#define locks_verify_locked(a) (0)
> +#define locks_verify_truncate(a, b, c) (0)
> +#define break_lease(a, b) (0)
> +#endif /* CONFIG_FILE_LOCKING */
>  
>  /* fs/open.c */
>  
> Index: linuxdev/init/Kconfig
> ===================================================================
> --- linuxdev.orig/init/Kconfig
> +++ linuxdev/init/Kconfig
> @@ -732,6 +732,14 @@
>            by some high performance threaded applications. Disabling
>            this option saves about 7k.
>  
> +config FILE_LOCKING
> +	bool "Enable POSIX file locking API" if EMBEDDED
> +	default y
> +	help
> +	  This option enables standard file locking support, required
> +          for filesystems like NFS and for the flock() system
> +          call. Disabling this option saves about 11k.
> +
>  config VM_EVENT_COUNTERS
>  	default y
>  	bool "Enable VM event counters for /proc/vmstat" if EMBEDDED
> Index: linuxdev/kernel/sys_ni.c
> ===================================================================
> --- linuxdev.orig/kernel/sys_ni.c
> +++ linuxdev/kernel/sys_ni.c
> @@ -130,6 +130,7 @@
>  cond_syscall(sys_io_submit);
>  cond_syscall(sys_io_cancel);
>  cond_syscall(sys_io_getevents);
> +cond_syscall(sys_flock);
>  
>  /* arch-specific weak syscall entries */
>  cond_syscall(sys_pciconfig_read);
> Index: linuxdev/kernel/sysctl.c
> ===================================================================
> --- linuxdev.orig/kernel/sysctl.c
> +++ linuxdev/kernel/sysctl.c
> @@ -97,7 +97,7 @@
>  static int neg_one = -1;
>  #endif
>  
> -#ifdef CONFIG_MMU
> +#if defined(CONFIG_MMU) && defined(CONFIG_FILE_LOCKING)
>  static int two = 2;
>  #endif
>  
> @@ -1260,6 +1260,7 @@
>  		.extra1		= &minolduid,
>  		.extra2		= &maxolduid,
>  	},
> +#ifdef CONFIG_FILE_LOCKING
>  	{
>  		.ctl_name	= FS_LEASES,
>  		.procname	= "leases-enable",
> @@ -1268,6 +1269,7 @@
>  		.mode		= 0644,
>  		.proc_handler	= &proc_dointvec,
>  	},
> +#endif
>  #ifdef CONFIG_DNOTIFY
>  	{
>  		.ctl_name	= FS_DIR_NOTIFY,
> @@ -1279,6 +1281,7 @@
>  	},
>  #endif
>  #ifdef CONFIG_MMU
> +#ifdef CONFIG_FILE_LOCKING
>  	{
>  		.ctl_name	= FS_LEASE_TIME,
>  		.procname	= "lease-break-time",
> @@ -1290,6 +1293,7 @@
>  		.extra1		= &zero,
>  		.extra2		= &two,
>  	},
> +#endif /* CONFIG_FILE_LOCKING */
>  #ifdef CONFIG_AIO
>  	{
>  		.procname	= "aio-nr",
> 
> -- 
> Thomas Petazzoni, Free Electrons
> Kernel, drivers and embedded Linux development,
> consulting, training and support.
> http://free-electrons.com
> --
> To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply

* Re: [PATCH 2/6] Container Freezer: Make refrigerator always available
From: Rafael J. Wysocki @ 2008-08-02 14:34 UTC (permalink / raw)
  To: Matt Helsley
  Cc: Andrew Morton, Thomas Petazzoni, Paul Menage, Li Zefan,
	Linux-Kernel, Linux Containers, linux-pm, Cedric Le Goater,
	Serge E. Hallyn, Michael Opdenacker, linux-embedded
In-Reply-To: <1217633074.25300.281.camel@localhost.localdomain>

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset="macroman", Size: 7822 bytes --]

On Saturday, 2 of August 2008, Matt Helsley wrote:
> 
> On Sat, 2008-08-02 at 00:53 +-0200, Rafael J. Wysocki wrote:
> > On Friday, 1 of August 2008, Matt Helsley wrote:
> > > 
> > > On Fri, 2008-08-01 at 16:27 +-0200, Thomas Petazzoni wrote:
> > > > Hi,
> > > > 
> > > > Le Thu, 31 Jul 2008 22:07:01 -0700,
> > > > Matt Helsley <matthltc@us.ibm.com> a +AOk-crit :
> > > > 
> > > > > --- a/kernel/Makefile
> > > > > +-+-+- b/kernel/Makefile
> > > > > @@ -5,7 +-5,7 @@
> > > > >  obj-y     = sched.o fork.o exec_domain.o panic.o printk.o +AFw
> > > > >  	    cpu.o exit.o itimer.o time.o softirq.o resource.o +AFw
> > > > >  	    sysctl.o capability.o ptrace.o timer.o user.o +AFw
> > > > > -	    signal.o sys.o kmod.o workqueue.o pid.o +AFw
> > > > > +-	    signal.o sys.o kmod.o workqueue.o pid.o freezer.o +AFw
> > > > 
> > > > I have the impression that the code in kernel/power/process.c was
> > > > compiled only if CONFIG_PM_SLEEP was set. Now that the code has been
> > > > moved to kernel/freezer.c, it is unconditionnaly compiled in every
> > > > kernel. Is that correct ?
> > > >
> > > > If so, is it possible to put this new feature under some
> > > > CONFIG_SOMETHING option, for people who care about the kernel size ?
> > > 
> > > 	How about making it depend on a combination of CONFIG variables?
> > > Here's an RFC PATCH. Completely untested.
> > > 
> > > Signed-off-by: Matt Helsley <matthltc@us.ibm.com>
> > 
> > Can you please also make the contents of include/linux/freezer.h depend on
> > CONFIG_FREEZER instead of CONFIG_PM_SLEEP?
> 
> Good point -- I'll add that to this patch and repost.
> 
> > Also, I'm not really sure if kernel/power/Kconfig is the right place to define
> > CONFIG_FREEZER.
> 
> 	There's no nice place to put it since we're dealing with CONFIG_
> variables in two different Kconfig files. I put it in
> kernel/power/Kconfig because I wasn't certain Kbuild would do the right
> thing if I referenced PM_SLEEP from init/Kconfig.
> 
> > Perhaps we should even move freezer.c from kernel/power to kernel
> 
> It's already there.

Yes, sorry.

> Perhaps you meant something else (kernel/power/process.c?)?

Well, I'll have to actually apply the patches and look at the modified code.

> > and define CONFIG_FREEZER in Kconfig in there.  Andrew, what do you think?
> 
> The Kconfig files in kernel/ are Kconfig.hz and Kconfig.preemt which
> don't seem appropriate. I suppose we could add another (perhaps
> Kconfig.cgroup).

Either that, or Kconfig.freezer maybe?  After all, it will also be used for
PM_SLEEP, at least for some time.

> Thanks for the review!

You're welcome.

Thanks,
Rafael
\07mNó\x7f\0\0ùn\0\0\0\0\0Ð7mNó\x7f\0\0p4o\0\0\0\0\0\0\0\0\0\0\0\0\00¾g\0\0\0\0\0A\x15\0\0\0\0\0\0pà\x01\0\0\0\0À©šMó\x7f\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0Ð7mNó\x7f\0\0 5o\0\0\0\0\0\0\0\0\0\0\0\0\0Ð7mNó\x7f\0\0ùn\0\0\0\0\0Ð7mNó\x7f\0\0`5o\0\0\0\0\0\0\0\0\0\0\0\0\0€5o\0\0\0\0\0Ñ\x14\0\0\0\0\0\0pà\x01\0\0\0\0À©šMó\x7f\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0Ð7mNó\x7f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ð7mNó\x7f\0\0àZo\0\0\0\0\0\0\0\0\0\0\0\0\0Ð7mNó\x7f\0\0@!o\0\0\0\0\0Ð7mNó\x7f\0\0À[o\0\0\0\0\0\0\0\0\0\0\0\0\0à[o\0\0\0\0\0á\x02\0\0\0\0\0\0pà\x01\0\0\0\0À©šMó\x7f\0\0€\x0e‚\x01\0\0\0\0\x01\0\0\0\0\0\0\0Ð7mNó\x7f\0\0\0\o\0\0\0\0\0\0\0\0\0\0\0\0\0Ð7mNó\x7f\0\0@!o\0\0\0\0\0Ð7mNó\x7f\0\0°\o\0\0\0\0\0\0\0\0\0\0\0\0\0Ð\o\0\0\0\0\0q\x02\0\0\0\0\0\0pà\x01\0\0\0\0À©šMó\x7f\0\0 \x11‚\x01\0\0\0\0\x01\0\0\0\0\0\0\0Ð7mNó\x7f\0\0ð\o\0\0\0\0\0\0\0\0\0\0\0\0\0Ð7mNó\x7f\0\0@!o\0\0\0\0\0Ð7mNó\x7f\0\0 ]o\0\0\0\0\0\0\0\0\0\0\0\0\0À]o\0\0\0\0\0\x01\x02\0\0\0\0\0\0pà\x01\0\0\0\0À©šMó\x7f\0\0@\x10‚\x01\0\0\0\0\x01\0\0\0\0\0\0\0Ð7mNó\x7f\0\0à]o\0\0\0\0\0\0\0\0\0\0\0\0\0Ð7mNó\x7f\0\0@!o\0\0\0\0\0Ð7mNó\x7f\0\0^o\0\0\0\0\0\0\0\0\0\0\0\0\0°^o\0\0\0\0\0‘\x01\0\0\0\0\0\0pà\x01\0\0\0\0À©šMó\x7f\0\0`\x0f‚\x01\0\0\0\0\x01\0\0\0\0\0\0\0Ð7mNó\x7f\0\0Ð^o\0\0\0\0\0\0\0\0\0\0\0\0\0Ð7mNó\x7f\0\0@!o\0\0\0\0\0Ð7mNó\x7f\0\0€_o\0\0\0\0\0\0\0\0\0\0\0

^ permalink raw reply

* Re: [PATCH 2/6] Container Freezer: Make refrigerator always available
From: Thomas Petazzoni @ 2008-08-02 10:39 UTC (permalink / raw)
  To: Matt Helsley
  Cc: Andrew Morton, Rafael J. Wysocki, Paul Menage, Li Zefan,
	Linux-Kernel, Linux Containers, linux-pm, Cedric Le Goater,
	Serge E. Hallyn, Michael Opdenacker, linux-embedded
In-Reply-To: <1217617689.25300.213.camel@localhost.localdomain>

Le Fri, 01 Aug 2008 12:08:09 -0700,
Matt Helsley <matthltc@us.ibm.com> a écrit :

> 	How about making it depend on a combination of CONFIG
> variables? Here's an RFC PATCH. Completely untested.

It solves my kernel size increase problem, so it's perfectly fine for
me.

Thanks!

Thomas
-- 
Thomas Petazzoni, Free Electrons
Kernel, drivers and embedded Linux development,
consulting, training and support.
http://free-electrons.com

^ permalink raw reply

* Re: prevalence of C++ in embedded linux?
From: Ben Nizette @ 2008-08-02  4:14 UTC (permalink / raw)
  To: Robert P. J. Day; +Cc: Embedded Linux mailing list
In-Reply-To: <1217281654.3546.16.camel@moss.renham>


On Tue, 2008-07-29 at 07:47 +1000, Ben Nizette wrote:
> On Mon, 2008-07-28 at 11:43 -0400, Robert P. J. Day wrote:
> > just curious -- how many folks are working in C++ in their embedded
> > linux work?
> 
> I hang out on AVRFreaks - an AVR and AVR32 support forum - quite a bit.
> I personally think C++ is the language of the devil but I'd say that
> around 50% of the people I talk to on 'freaks think otherwise.  It's
> certainly the language of choice.

Having said that, I would appear to be quite wrong.  Of course, I only
see people's language of choice on a support forum when it doesn't work
as they'd like.  From those numbers I got the 50% figure.  A quick poll
[1] doesn't even almost agree, though admittedly the sample group isn't
huge yet.

Interesting.

	--Ben.

[1]
http://www.avrfreaks.net/index.php?name=PNphpBB2&file=viewtopic&p=473243#473243

^ permalink raw reply

* Re: [PATCH 2/6] Container Freezer: Make refrigerator always available
From: Matt Helsley @ 2008-08-02  2:30 UTC (permalink / raw)
  To: Rafael J. Wysocki
  Cc: Andrew Morton, Thomas Petazzoni, Paul Menage, Li Zefan,
	Linux-Kernel, Linux Containers, linux-pm, Cedric Le Goater,
	Serge E. Hallyn, Michael Opdenacker, linux-embedded
In-Reply-To: <200808020053.18638.rjw@sisk.pl>


On Sat, 2008-08-02 at 00:53 +-0200, Rafael J. Wysocki wrote:
+AD4 On Friday, 1 of August 2008, Matt Helsley wrote:
+AD4 +AD4 
+AD4 +AD4 On Fri, 2008-08-01 at 16:27 +-0200, Thomas Petazzoni wrote:
+AD4 +AD4 +AD4 Hi,
+AD4 +AD4 +AD4 
+AD4 +AD4 +AD4 Le Thu, 31 Jul 2008 22:07:01 -0700,
+AD4 +AD4 +AD4 Matt Helsley +ADw-matthltc+AEA-us.ibm.com+AD4 a +AOk-crit :
+AD4 +AD4 +AD4 
+AD4 +AD4 +AD4 +AD4 --- a/kernel/Makefile
+AD4 +AD4 +AD4 +AD4 +-+-+- b/kernel/Makefile
+AD4 +AD4 +AD4 +AD4 +AEAAQA -5,7 +-5,7 +AEAAQA
+AD4 +AD4 +AD4 +AD4  obj-y     +AD0 sched.o fork.o exec+AF8-domain.o panic.o printk.o +AFw
+AD4 +AD4 +AD4 +AD4  	    cpu.o exit.o itimer.o time.o softirq.o resource.o +AFw
+AD4 +AD4 +AD4 +AD4  	    sysctl.o capability.o ptrace.o timer.o user.o +AFw
+AD4 +AD4 +AD4 +AD4 -	    signal.o sys.o kmod.o workqueue.o pid.o +AFw
+AD4 +AD4 +AD4 +AD4 +-	    signal.o sys.o kmod.o workqueue.o pid.o freezer.o +AFw
+AD4 +AD4 +AD4 
+AD4 +AD4 +AD4 I have the impression that the code in kernel/power/process.c was
+AD4 +AD4 +AD4 compiled only if CONFIG+AF8-PM+AF8-SLEEP was set. Now that the code has been
+AD4 +AD4 +AD4 moved to kernel/freezer.c, it is unconditionnaly compiled in every
+AD4 +AD4 +AD4 kernel. Is that correct ?
+AD4 +AD4 +AD4
+AD4 +AD4 +AD4 If so, is it possible to put this new feature under some
+AD4 +AD4 +AD4 CONFIG+AF8-SOMETHING option, for people who care about the kernel size ?
+AD4 +AD4 
+AD4 +AD4 	How about making it depend on a combination of CONFIG variables?
+AD4 +AD4 Here's an RFC PATCH. Completely untested.
+AD4 +AD4 
+AD4 +AD4 Signed-off-by: Matt Helsley +ADw-matthltc+AEA-us.ibm.com+AD4
+AD4 
+AD4 Can you please also make the contents of include/linux/freezer.h depend on
+AD4 CONFIG+AF8-FREEZER instead of CONFIG+AF8-PM+AF8-SLEEP?

Done.

+AD4 Also, I'm not really sure if kernel/power/Kconfig is the right place to define
+AD4 CONFIG+AF8-FREEZER.
+AD4 
+AD4 Perhaps we should even move freezer.c from kernel/power to kernel
+AD4 and define CONFIG+AF8-FREEZER in Kconfig in there.  Andrew, what do you think?

	I'll check this weekend for replies and repost the RFC PATCH on Monday
if I don't hear anything. In the meantime I'll be doing some config
build testing with the above changes to make sure it's correct.

Cheers,
	-Matt

^ permalink raw reply

* Re: [PATCH 2/6] Container Freezer: Make refrigerator always available
From: Matt Helsley @ 2008-08-01 23:24 UTC (permalink / raw)
  To: Rafael J. Wysocki
  Cc: Andrew Morton, Thomas Petazzoni, Paul Menage, Li Zefan,
	Linux-Kernel, Linux Containers, linux-pm, Cedric Le Goater,
	Serge E. Hallyn, Michael Opdenacker, linux-embedded
In-Reply-To: <200808020053.18638.rjw@sisk.pl>


On Sat, 2008-08-02 at 00:53 +-0200, Rafael J. Wysocki wrote:
+AD4 On Friday, 1 of August 2008, Matt Helsley wrote:
+AD4 +AD4 
+AD4 +AD4 On Fri, 2008-08-01 at 16:27 +-0200, Thomas Petazzoni wrote:
+AD4 +AD4 +AD4 Hi,
+AD4 +AD4 +AD4 
+AD4 +AD4 +AD4 Le Thu, 31 Jul 2008 22:07:01 -0700,
+AD4 +AD4 +AD4 Matt Helsley +ADw-matthltc+AEA-us.ibm.com+AD4 a +AOk-crit :
+AD4 +AD4 +AD4 
+AD4 +AD4 +AD4 +AD4 --- a/kernel/Makefile
+AD4 +AD4 +AD4 +AD4 +-+-+- b/kernel/Makefile
+AD4 +AD4 +AD4 +AD4 +AEAAQA -5,7 +-5,7 +AEAAQA
+AD4 +AD4 +AD4 +AD4  obj-y     +AD0 sched.o fork.o exec+AF8-domain.o panic.o printk.o +AFw
+AD4 +AD4 +AD4 +AD4  	    cpu.o exit.o itimer.o time.o softirq.o resource.o +AFw
+AD4 +AD4 +AD4 +AD4  	    sysctl.o capability.o ptrace.o timer.o user.o +AFw
+AD4 +AD4 +AD4 +AD4 -	    signal.o sys.o kmod.o workqueue.o pid.o +AFw
+AD4 +AD4 +AD4 +AD4 +-	    signal.o sys.o kmod.o workqueue.o pid.o freezer.o +AFw
+AD4 +AD4 +AD4 
+AD4 +AD4 +AD4 I have the impression that the code in kernel/power/process.c was
+AD4 +AD4 +AD4 compiled only if CONFIG+AF8-PM+AF8-SLEEP was set. Now that the code has been
+AD4 +AD4 +AD4 moved to kernel/freezer.c, it is unconditionnaly compiled in every
+AD4 +AD4 +AD4 kernel. Is that correct ?
+AD4 +AD4 +AD4
+AD4 +AD4 +AD4 If so, is it possible to put this new feature under some
+AD4 +AD4 +AD4 CONFIG+AF8-SOMETHING option, for people who care about the kernel size ?
+AD4 +AD4 
+AD4 +AD4 	How about making it depend on a combination of CONFIG variables?
+AD4 +AD4 Here's an RFC PATCH. Completely untested.
+AD4 +AD4 
+AD4 +AD4 Signed-off-by: Matt Helsley +ADw-matthltc+AEA-us.ibm.com+AD4
+AD4 
+AD4 Can you please also make the contents of include/linux/freezer.h depend on
+AD4 CONFIG+AF8-FREEZER instead of CONFIG+AF8-PM+AF8-SLEEP?

Good point -- I'll add that to this patch and repost.

+AD4 Also, I'm not really sure if kernel/power/Kconfig is the right place to define
+AD4 CONFIG+AF8-FREEZER.

	There's no nice place to put it since we're dealing with CONFIG+AF8
variables in two different Kconfig files. I put it in
kernel/power/Kconfig because I wasn't certain Kbuild would do the right
thing if I referenced PM+AF8-SLEEP from init/Kconfig.

+AD4 Perhaps we should even move freezer.c from kernel/power to kernel

It's already there. Perhaps you meant something else
(kernel/power/process.c?)?

+AD4 and define CONFIG+AF8-FREEZER in Kconfig in there.  Andrew, what do you think?

The Kconfig files in kernel/ are Kconfig.hz and Kconfig.preemt which
don't seem appropriate. I suppose we could add another (perhaps
Kconfig.cgroup).

Thanks for the review+ACE

Cheers,
	-Matt

^ permalink raw reply


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox