From: Qian Cai <cai@lca.pw>
To: -Gary- <me@garybgenett.net>
Cc: Vlastimil Babka <vbabka@suse.cz>, Hugh Dickins <hughd@google.com>,
linux-mm@kvack.org
Subject: Re: [PATCH] shmem: make shmem default size a define value
Date: Wed, 09 Oct 2019 16:56:27 -0400 [thread overview]
Message-ID: <1570654587.5937.18.camel@lca.pw> (raw)
In-Reply-To: <20191009201745.GF22291@spider>
On Wed, 2019-10-09 at 13:17 -0700, -Gary- wrote:
> > > @@ -125,14 +128,14 @@ struct shmem_options {
> > > #ifdef CONFIG_TMPFS
> > > static unsigned long shmem_default_max_blocks(void)
> > > {
> > > - return totalram_pages() / 2;
> > > + return SHMEM_SIZE_DEFAULT;
> > > }
> > >
> > > static unsigned long shmem_default_max_inodes(void)
> > > {
> > > unsigned long nr_pages = totalram_pages();
> >
> > This is now unused.
>
> Mind telling me what I missed, Qian?
>
> I pulled from:
> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
>
> Latest commit is:
> 2019-10-08 15:36:04 -0700 e3280b54afed870d531571212f1fc375df39b7d2 Merge tag 'led-fixes-for-5.4-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/j.anaszewski/linux-leds
>
> My patch is based on that, where the above code still exists, and nr_pages is still referenced below. Apparently, it is making totalram_pages atomic, according to the commit that changed it:
> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/diff/mm/shmem.c?id=ca79b0c211af63fa3276f0e3fd7dd9ada2439839
>
> Should I be pulling from somewhere else, or also re-hacking nr_pages somehow?
Ah, you are right that nr_pages is still referenced, but then there could a
potentially out of sync? Would that be a problem? Is the compiler just smart
enough to call totalram_pages() only once?
CPU0: CPU1:
unsigned long nr_pages = totalram_pages();
totalram_pages_inc()
min(nr_pages - totalhigh_pages(), SHMEM_SIZE_DEFAULT);
>
> -- Gary
>
> > > - return min(nr_pages - totalhigh_pages(), nr_pages / 2);
> > > + return min(nr_pages - totalhigh_pages(), SHMEM_SIZE_DEFAULT);
> > > }
> > > #endif
next prev parent reply other threads:[~2019-10-09 20:56 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-10-09 18:46 [PATCH] shmem: make shmem default size a define value Gary B. Genett
2019-10-09 19:01 ` Qian Cai
2019-10-09 20:17 ` -Gary-
2019-10-09 20:56 ` Qian Cai [this message]
2019-10-09 23:17 ` -Gary-
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1570654587.5937.18.camel@lca.pw \
--to=cai@lca.pw \
--cc=hughd@google.com \
--cc=linux-mm@kvack.org \
--cc=me@garybgenett.net \
--cc=vbabka@suse.cz \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.