From: "Gary B. Genett" <me@garybgenett.net>
To: Qian Cai <cai@lca.pw>, Vlastimil Babka <vbabka@suse.cz>
Cc: Hugh Dickins <hughd@google.com>, linux-mm@kvack.org
Subject: [PATCH] shmem: make shmem default size a define value
Date: Wed, 9 Oct 2019 11:46:04 -0700 [thread overview]
Message-ID: <20191009184604.GA5162@spider> (raw)
The default size of the shmem filesystem is currently set to 50% of
memory using a magic token. This change makes it a define value, so
that it is clearly denoted as a global value, and to make it easier to
track down and identify.
No behavior is changed, and no additional processing is created.
Signed-off-by: Gary B. Genett <me@garybgenett.net>
---
mm/shmem.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/mm/shmem.c b/mm/shmem.c
index cd570cc79c76..bc758cfb4cb6 100644
--- a/mm/shmem.c
+++ b/mm/shmem.c
@@ -95,6 +95,9 @@ static struct vfsmount *shm_mnt;
/* Symlink up to this size is kmalloc'ed instead of using a swappable page */
#define SHORT_SYMLINK_LEN 128
+/* Default size of shmem filesystem */
+#define SHMEM_SIZE_DEFAULT (totalram_pages() / 2)
+
/*
* shmem_fallocate communicates with shmem_fault or shmem_writepage via
* inode->i_private (with i_mutex making sure that it has only one user at
@@ -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();
- return min(nr_pages - totalhigh_pages(), nr_pages / 2);
+ return min(nr_pages - totalhigh_pages(), SHMEM_SIZE_DEFAULT);
}
#endif
--
2.15.2
next reply other threads:[~2019-10-09 18:46 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-10-09 18:46 Gary B. Genett [this message]
2019-10-09 19:01 ` [PATCH] shmem: make shmem default size a define value Qian Cai
2019-10-09 20:17 ` -Gary-
2019-10-09 20:56 ` Qian Cai
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=20191009184604.GA5162@spider \
--to=me@garybgenett.net \
--cc=cai@lca.pw \
--cc=hughd@google.com \
--cc=linux-mm@kvack.org \
--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.