linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Kernel size increase of +256 KiB (was: Re: RPCSEC_GSS: Share all credential caches on a per-transport basis)
@ 2013-09-12 13:24 Geert Uytterhoeven
  2013-09-12 14:13 ` Myklebust, Trond
  0 siblings, 1 reply; 5+ messages in thread
From: Geert Uytterhoeven @ 2013-09-12 13:24 UTC (permalink / raw)
  To: Trond Myklebust; +Cc: Linux/m68k, linux-kernel@vger.kernel.org

On Mon, Sep 9, 2013 at 6:57 PM, Linux Kernel Mailing List
<linux-kernel@vger.kernel.org> wrote:
> diff --git a/net/sunrpc/auth_gss/auth_gss.c b/net/sunrpc/auth_gss/auth_gss.c
> index 5ec15bb..dc4b449 100644
> --- a/net/sunrpc/auth_gss/auth_gss.c
> +++ b/net/sunrpc/auth_gss/auth_gss.c
> @@ -51,6 +51,7 @@
>  #include <linux/sunrpc/rpc_pipe_fs.h>
>  #include <linux/sunrpc/gss_api.h>
>  #include <asm/uaccess.h>
> +#include <linux/hashtable.h>
>
>  #include "../netns.h"
>
> @@ -71,6 +72,9 @@ static unsigned int gss_expired_cred_retry_delay = GSS_RETRY_EXPIRED;
>   * using integrity (two 4-byte integers): */
>  #define GSS_VERF_SLACK         100
>
> +static DEFINE_HASHTABLE(gss_auth_hash_table, 16);
> +static DEFINE_SPINLOCK(gss_auth_hash_lock);

Today's m68k/atari-defconfig kernel no longer boots, as it became larger than
4 MiB.

bloat-o-meter tells me:

function                                     old     new   delta
gss_auth_hash_table                            -  262144 +262144

Woops...

Are you trying to game Tim's survey? ;-)
(question 13 at http://www.embeddedlinuxconference.com/cgi-bin/survey.cgi)

Can this memory be allocated dynamically / only when it's used?

Thanks!

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

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

* Re: Kernel size increase of +256 KiB (was: Re: RPCSEC_GSS: Share all credential caches on a per-transport basis)
  2013-09-12 13:24 Kernel size increase of +256 KiB (was: Re: RPCSEC_GSS: Share all credential caches on a per-transport basis) Geert Uytterhoeven
@ 2013-09-12 14:13 ` Myklebust, Trond
  2013-09-12 19:20   ` Geert Uytterhoeven
  0 siblings, 1 reply; 5+ messages in thread
From: Myklebust, Trond @ 2013-09-12 14:13 UTC (permalink / raw)
  To: Geert Uytterhoeven; +Cc: Linux/m68k, linux-kernel@vger.kernel.org

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

On Thu, 2013-09-12 at 15:24 +0200, Geert Uytterhoeven wrote:
> On Mon, Sep 9, 2013 at 6:57 PM, Linux Kernel Mailing List
> <linux-kernel@vger.kernel.org> wrote:
> > diff --git a/net/sunrpc/auth_gss/auth_gss.c b/net/sunrpc/auth_gss/auth_gss.c
> > index 5ec15bb..dc4b449 100644
> > --- a/net/sunrpc/auth_gss/auth_gss.c
> > +++ b/net/sunrpc/auth_gss/auth_gss.c
> > @@ -51,6 +51,7 @@
> >  #include <linux/sunrpc/rpc_pipe_fs.h>
> >  #include <linux/sunrpc/gss_api.h>
> >  #include <asm/uaccess.h>
> > +#include <linux/hashtable.h>
> >
> >  #include "../netns.h"
> >
> > @@ -71,6 +72,9 @@ static unsigned int gss_expired_cred_retry_delay = GSS_RETRY_EXPIRED;
> >   * using integrity (two 4-byte integers): */
> >  #define GSS_VERF_SLACK         100
> >
> > +static DEFINE_HASHTABLE(gss_auth_hash_table, 16);
> > +static DEFINE_SPINLOCK(gss_auth_hash_lock);
> 
> Today's m68k/atari-defconfig kernel no longer boots, as it became larger than
> 4 MiB.
> 
> bloat-o-meter tells me:
> 
> function                                     old     new   delta
> gss_auth_hash_table                            -  262144 +262144
> 
> Woops...

Whoops indeed. The above should have declared 16 buckets, and not 1<<16.
I fell for Sasha's subtle trap...

> Are you trying to game Tim's survey? ;-)
> (question 13 at http://www.embeddedlinuxconference.com/cgi-bin/survey.cgi)
> 
> Can this memory be allocated dynamically / only when it's used?

:-) It's declared inside a module, so that should already be the case,
however I'll send in a patch to change the above to the intended:

DEFINE_HASHTABLE(gss_auth_hash_table, 4);

Thanks Geert!

-- 
Trond Myklebust
Linux NFS client maintainer

NetApp
Trond.Myklebust@netapp.com
www.netapp.com
ÿôèº{.nÇ+‰·Ÿ®‰­†+%ŠËÿ±éݶ\x17¥Šwÿº{.nÇ+‰·¥Š{±þG«éÿŠ{ayº\x1dʇڙë,j\a­¢f£¢·hšïêÿ‘êçz_è®\x03(­éšŽŠÝ¢j"ú\x1a¶^[m§ÿÿ¾\a«þG«éÿ¢¸?™¨è­Ú&£ø§~á¶iO•æ¬z·švØ^\x14\x04\x1a¶^[m§ÿÿÃ\fÿ¶ìÿ¢¸?–I¥

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

* Re: Kernel size increase of +256 KiB (was: Re: RPCSEC_GSS: Share all credential caches on a per-transport basis)
  2013-09-12 14:13 ` Myklebust, Trond
@ 2013-09-12 19:20   ` Geert Uytterhoeven
  2013-09-12 20:17     ` Myklebust, Trond
  0 siblings, 1 reply; 5+ messages in thread
From: Geert Uytterhoeven @ 2013-09-12 19:20 UTC (permalink / raw)
  To: Myklebust, Trond; +Cc: Linux/m68k, linux-kernel@vger.kernel.org

On Thu, Sep 12, 2013 at 4:13 PM, Myklebust, Trond
<Trond.Myklebust@netapp.com> wrote:
>> > --- a/net/sunrpc/auth_gss/auth_gss.c
>> > +++ b/net/sunrpc/auth_gss/auth_gss.c
>> > @@ -51,6 +51,7 @@
>> >  #include <linux/sunrpc/rpc_pipe_fs.h>
>> >  #include <linux/sunrpc/gss_api.h>
>> >  #include <asm/uaccess.h>
>> > +#include <linux/hashtable.h>
>> >
>> >  #include "../netns.h"
>> >
>> > @@ -71,6 +72,9 @@ static unsigned int gss_expired_cred_retry_delay = GSS_RETRY_EXPIRED;
>> >   * using integrity (two 4-byte integers): */
>> >  #define GSS_VERF_SLACK         100
>> >
>> > +static DEFINE_HASHTABLE(gss_auth_hash_table, 16);
>> > +static DEFINE_SPINLOCK(gss_auth_hash_lock);
>>
>> Today's m68k/atari-defconfig kernel no longer boots, as it became larger than
>> 4 MiB.
>>
>> bloat-o-meter tells me:
>>
>> function                                     old     new   delta
>> gss_auth_hash_table                            -  262144 +262144
>>
>> Woops...
>
> Whoops indeed. The above should have declared 16 buckets, and not 1<<16.
> I fell for Sasha's subtle trap...
>
>> Are you trying to game Tim's survey? ;-)
>> (question 13 at http://www.embeddedlinuxconference.com/cgi-bin/survey.cgi)
>>
>> Can this memory be allocated dynamically / only when it's used?
>
> :-) It's declared inside a module, so that should already be the case,

Only for the modular case. What about builtin, e.g. for nfsroot?

Or is it better to not build in NFS_V4 support in that case?

config NFS_V4
          If unsure, say Y.

config NFSD_V4
          If unsure, say N.

So that's why my defconfig has NFS_V4 but not NFSD_V4.

> however I'll send in a patch to change the above to the intended:
>
> DEFINE_HASHTABLE(gss_auth_hash_table, 4);

Thanks, that's better! Booting again ;-)

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

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

* Re: Kernel size increase of +256 KiB (was: Re: RPCSEC_GSS: Share all credential caches on a per-transport basis)
  2013-09-12 19:20   ` Geert Uytterhoeven
@ 2013-09-12 20:17     ` Myklebust, Trond
  2013-09-13  6:23       ` Geert Uytterhoeven
  0 siblings, 1 reply; 5+ messages in thread
From: Myklebust, Trond @ 2013-09-12 20:17 UTC (permalink / raw)
  To: Geert Uytterhoeven; +Cc: Linux/m68k, linux-kernel@vger.kernel.org

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

On Thu, 2013-09-12 at 21:20 +0200, Geert Uytterhoeven wrote:
> On Thu, Sep 12, 2013 at 4:13 PM, Myklebust, Trond
> <Trond.Myklebust@netapp.com> wrote:
> >> > --- a/net/sunrpc/auth_gss/auth_gss.c
> >> > +++ b/net/sunrpc/auth_gss/auth_gss.c
> >> > @@ -51,6 +51,7 @@
> >> >  #include <linux/sunrpc/rpc_pipe_fs.h>
> >> >  #include <linux/sunrpc/gss_api.h>
> >> >  #include <asm/uaccess.h>
> >> > +#include <linux/hashtable.h>
> >> >
> >> >  #include "../netns.h"
> >> >
> >> > @@ -71,6 +72,9 @@ static unsigned int gss_expired_cred_retry_delay = GSS_RETRY_EXPIRED;
> >> >   * using integrity (two 4-byte integers): */
> >> >  #define GSS_VERF_SLACK         100
> >> >
> >> > +static DEFINE_HASHTABLE(gss_auth_hash_table, 16);
> >> > +static DEFINE_SPINLOCK(gss_auth_hash_lock);
> >>
> >> Today's m68k/atari-defconfig kernel no longer boots, as it became larger than
> >> 4 MiB.
> >>
> >> bloat-o-meter tells me:
> >>
> >> function                                     old     new   delta
> >> gss_auth_hash_table                            -  262144 +262144
> >>
> >> Woops...
> >
> > Whoops indeed. The above should have declared 16 buckets, and not 1<<16.
> > I fell for Sasha's subtle trap...
> >
> >> Are you trying to game Tim's survey? ;-)
> >> (question 13 at http://www.embeddedlinuxconference.com/cgi-bin/survey.cgi)
> >>
> >> Can this memory be allocated dynamically / only when it's used?
> >
> > :-) It's declared inside a module, so that should already be the case,
> 
> Only for the modular case. What about builtin, e.g. for nfsroot?
> 
> Or is it better to not build in NFS_V4 support in that case?
> 
> config NFS_V4
>           If unsure, say Y.
> 
> config NFSD_V4
>           If unsure, say N.
> 
> So that's why my defconfig has NFS_V4 but not NFSD_V4.

It should be possible now to compile in NFSv3 support (and/or NFSv2),
while keeping NFSv4 a module. That will usually result in
CONFIG_SUNRPC_GSS=m...

Of course, if your defconfig doesn't have module support then, yes, your
only option to avoid compiling in rpcsec_gss is to not select NFSv4 at
all.

-- 
Trond Myklebust
Linux NFS client maintainer

NetApp
Trond.Myklebust@netapp.com
www.netapp.com
ÿôèº{.nÇ+‰·Ÿ®‰­†+%ŠËÿ±éݶ\x17¥Šwÿº{.nÇ+‰·¥Š{±þG«éÿŠ{ayº\x1dʇڙë,j\a­¢f£¢·hšïêÿ‘êçz_è®\x03(­éšŽŠÝ¢j"ú\x1a¶^[m§ÿÿ¾\a«þG«éÿ¢¸?™¨è­Ú&£ø§~á¶iO•æ¬z·švØ^\x14\x04\x1a¶^[m§ÿÿÃ\fÿ¶ìÿ¢¸?–I¥

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

* Re: Kernel size increase of +256 KiB (was: Re: RPCSEC_GSS: Share all credential caches on a per-transport basis)
  2013-09-12 20:17     ` Myklebust, Trond
@ 2013-09-13  6:23       ` Geert Uytterhoeven
  0 siblings, 0 replies; 5+ messages in thread
From: Geert Uytterhoeven @ 2013-09-13  6:23 UTC (permalink / raw)
  To: Myklebust, Trond; +Cc: Linux/m68k, linux-kernel@vger.kernel.org

On Thu, Sep 12, 2013 at 10:17 PM, Myklebust, Trond
<Trond.Myklebust@netapp.com> wrote:
>> Only for the modular case. What about builtin, e.g. for nfsroot?
>>
>> Or is it better to not build in NFS_V4 support in that case?
>>
>> config NFS_V4
>>           If unsure, say Y.
>>
>> config NFSD_V4
>>           If unsure, say N.
>>
>> So that's why my defconfig has NFS_V4 but not NFSD_V4.
>
> It should be possible now to compile in NFSv3 support (and/or NFSv2),
> while keeping NFSv4 a module. That will usually result in
> CONFIG_SUNRPC_GSS=m...

Indeed. Making NFS_V4 modular saves 102 KiB, i.e. 2.5% of a typical
almost-4-MiB kernel image!

> Of course, if your defconfig doesn't have module support then, yes, your
> only option to avoid compiling in rpcsec_gss is to not select NFSv4 at
> all.

It has. But it needs everything to boot (block, net, nfs) as built-in.

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

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

end of thread, other threads:[~2013-09-13  6:23 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-09-12 13:24 Kernel size increase of +256 KiB (was: Re: RPCSEC_GSS: Share all credential caches on a per-transport basis) Geert Uytterhoeven
2013-09-12 14:13 ` Myklebust, Trond
2013-09-12 19:20   ` Geert Uytterhoeven
2013-09-12 20:17     ` Myklebust, Trond
2013-09-13  6:23       ` Geert Uytterhoeven

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).