linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Topi Miettinen <toiwoton@gmail.com>
To: hughd@google.com, linux-mm@kvack.org
Subject: Tmpfs size accounting misses memory allocations
Date: Sat, 25 Apr 2020 15:33:54 +0300	[thread overview]
Message-ID: <63ab63bd-d6c6-a96a-9667-bbe8edb7cedb@gmail.com> (raw)

Hi,

It seems that tmpfs does not count memory which is allocated for short 
symlinks or xattrs towards size= limit. I guess the fix would be to 
change shmem_sb_info->{used_blocks,max_blocks} to use bytes as units 
(instead of blocks) and then add accounting and checks to 
shmem_symlink() and shmem_initxattrs(). Would a patch for that be 
acceptable?

Another issue is that inodes aren't counted towards size= limit either, 
but perhaps that's intentional because there's nr_inodes= mount option 
for exactly that.

If these are not bugs but intentional features, I think the manual page 
tmpfs(5) should be clearer in this respect.

-Topi


             reply	other threads:[~2020-04-25 12:34 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-25 12:33 Topi Miettinen [this message]
2020-04-28  1:34 ` Hugh Dickins
2020-04-28 10:51   ` Topi Miettinen
2020-05-01  3:14     ` Hugh Dickins
2020-05-01  7:29       ` Topi Miettinen
2020-05-01 19:05       ` Topi Miettinen
2020-05-03 19:58       ` Topi Miettinen

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=63ab63bd-d6c6-a96a-9667-bbe8edb7cedb@gmail.com \
    --to=toiwoton@gmail.com \
    --cc=hughd@google.com \
    --cc=linux-mm@kvack.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox