linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: cgel.zte@gmail.com
Cc: hughd@google.com, mike.kravetz@oracle.com, kirill@shutemov.name,
	songliubraving@fb.com, linux-mm@kvack.org,
	linux-kernel@vger.kernel.org, yang.yang29@zte.com.cn,
	wang.yong12@zte.com.cn, Zeal Robot <zealci@zte.com.cn>
Subject: Re: [PATCH linux-next] Fix shmem huge page failed to set F_SEAL_WRITE attribute problem
Date: Tue, 15 Feb 2022 14:12:36 -0800	[thread overview]
Message-ID: <20220215141236.de1a3eca3a8a52d04507c50f@linux-foundation.org> (raw)
In-Reply-To: <20220215073743.1769979-1-cgel.zte@gmail.com>

On Tue, 15 Feb 2022 07:37:43 +0000 cgel.zte@gmail.com wrote:

> From: wangyong <wang.yong12@zte.com.cn>
> 
> After enabling tmpfs filesystem to support transparent hugepage with the
> following command:
>  echo always > /sys/kernel/mm/transparent_hugepage/shmem_enabled
> The docker program adds F_SEAL_WRITE through the following command will
> prompt EBUSY.
>  fcntl(5, F_ADD_SEALS, F_SEAL_WRITE)=-1.
> 
> It is found that in memfd_wait_for_pins function, the page_count of
> hugepage is 512 and page_mapcount is 0, which does not meet the
> conditions:
>  page_count(page) - page_mapcount(page) != 1.
> But the page is not busy at this time, therefore, the page_order of
> hugepage should be taken into account in the calculation.

What are the real-world runtime effects of this?

Do we think that this fix (or one similar to it) should be backported
into -stable kernels?

If "yes" then Mike's 5d752600a8c373 ("mm: restructure memfd code") will
get in the way because it moved lots of code around.

But then, that's four years old and perhaps that's far enough back in
time.



  reply	other threads:[~2022-02-15 22:12 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-15  7:37 [PATCH linux-next] Fix shmem huge page failed to set F_SEAL_WRITE attribute problem cgel.zte
2022-02-15 22:12 ` Andrew Morton [this message]
2022-02-16  6:57   ` CGEL
2022-02-17  1:00 ` Mike Kravetz
2022-02-17  1:25   ` Hugh Dickins
2022-02-17 13:43     ` Matthew Wilcox
2022-02-27  3:00       ` Hugh Dickins
2022-02-27  5:20         ` [PATCH] memfd: fix F_SEAL_WRITE after shmem huge page allocated Hugh Dickins
2022-03-02  1:11           ` yong w
2022-03-02 19:52             ` Hugh Dickins

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=20220215141236.de1a3eca3a8a52d04507c50f@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=cgel.zte@gmail.com \
    --cc=hughd@google.com \
    --cc=kirill@shutemov.name \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mike.kravetz@oracle.com \
    --cc=songliubraving@fb.com \
    --cc=wang.yong12@zte.com.cn \
    --cc=yang.yang29@zte.com.cn \
    --cc=zealci@zte.com.cn \
    /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;
as well as URLs for NNTP newsgroup(s).