public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 3/3] user.c: #ifdef ->mq_bytes
@ 2007-09-21  9:40 Alexey Dobriyan
  2007-09-21  9:55 ` Cedric Le Goater
  0 siblings, 1 reply; 2+ messages in thread
From: Alexey Dobriyan @ 2007-09-21  9:40 UTC (permalink / raw)
  To: akpm; +Cc: linux-kernel, devel

for those who deselect POSIX message queues.

Reduces SLAB size of user_struct from 64 to 32 bytes here,
SLUB size -- from 40 bytes to 32 bytes.

Signed-off-by: Alexey Dobriyan <adobriyan@sw.ru>
---

 include/linux/sched.h |    2 ++
 kernel/user.c         |    2 --
 2 files changed, 2 insertions(+), 2 deletions(-)

--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -583,8 +583,10 @@ struct user_struct {
 	atomic_t inotify_watches; /* How many inotify watches does this user have? */
 	atomic_t inotify_devs;	/* How many inotify devs does this user have opened? */
 #endif
+#ifdef CONFIG_POSIX_MQUEUE
 	/* protected by mq_lock	*/
 	unsigned long mq_bytes;	/* How many bytes can be allocated to mqueue? */
+#endif
 	unsigned long locked_shm; /* How many pages of mlocked shm ? */
 
 #ifdef CONFIG_KEYS
--- a/kernel/user.c
+++ b/kernel/user.c
@@ -44,7 +44,6 @@ struct user_struct root_user = {
 	.processes	= ATOMIC_INIT(1),
 	.files		= ATOMIC_INIT(0),
 	.sigpending	= ATOMIC_INIT(0),
-	.mq_bytes	= 0,
 	.locked_shm     = 0,
 #ifdef CONFIG_KEYS
 	.uid_keyring	= &root_user_keyring,


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH 3/3] user.c: #ifdef ->mq_bytes
  2007-09-21  9:40 [PATCH 3/3] user.c: #ifdef ->mq_bytes Alexey Dobriyan
@ 2007-09-21  9:55 ` Cedric Le Goater
  0 siblings, 0 replies; 2+ messages in thread
From: Cedric Le Goater @ 2007-09-21  9:55 UTC (permalink / raw)
  To: Alexey Dobriyan; +Cc: akpm, linux-kernel, devel

Hello Alexey !

Alexey Dobriyan wrote:
> for those who deselect POSIX message queues.
> 
> Reduces SLAB size of user_struct from 64 to 32 bytes here,
> SLUB size -- from 40 bytes to 32 bytes.
> 
> Signed-off-by: Alexey Dobriyan <adobriyan@sw.ru>
> ---
> 
>  include/linux/sched.h |    2 ++
>  kernel/user.c         |    2 --
>  2 files changed, 2 insertions(+), 2 deletions(-)
> 
> --- a/include/linux/sched.h
> +++ b/include/linux/sched.h
> @@ -583,8 +583,10 @@ struct user_struct {
>  	atomic_t inotify_watches; /* How many inotify watches does this user have? */
>  	atomic_t inotify_devs;	/* How many inotify devs does this user have opened? */
>  #endif
> +#ifdef CONFIG_POSIX_MQUEUE
>  	/* protected by mq_lock	*/
>  	unsigned long mq_bytes;	/* How many bytes can be allocated to mqueue? */
> +#endif
>  	unsigned long locked_shm; /* How many pages of mlocked shm ? */

while you are it, it seems possible to #ifdef locked_shm also. it's a bit more 
complex because the code is mm/ and there are some links with the hugetlbfs 
also.

Cheers,

C.

>  #ifdef CONFIG_KEYS
> --- a/kernel/user.c
> +++ b/kernel/user.c
> @@ -44,7 +44,6 @@ struct user_struct root_user = {
>  	.processes	= ATOMIC_INIT(1),
>  	.files		= ATOMIC_INIT(0),
>  	.sigpending	= ATOMIC_INIT(0),
> -	.mq_bytes	= 0,
>  	.locked_shm     = 0,
>  #ifdef CONFIG_KEYS
>  	.uid_keyring	= &root_user_keyring,
> 
> -
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/
> 


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2007-09-21  9:56 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-09-21  9:40 [PATCH 3/3] user.c: #ifdef ->mq_bytes Alexey Dobriyan
2007-09-21  9:55 ` Cedric Le Goater

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