linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Mike Kravetz <mike.kravetz@oracle.com>
To: Hugh Dickins <hughd@google.com>, zhangyiru <zhangyiru3@huawei.com>
Cc: akpm@linux-foundation.org, linux-mm@kvack.org, mhocko@suse.com,
	wuxu.wu@huawei.com, liusirui@huawei.com, liuzixian4@huawei.com
Subject: Re: [PATCH v4] mm,hugetlb: remove mlock ulimit for SHM_HUGETLB
Date: Mon, 1 Nov 2021 14:39:10 -0700	[thread overview]
Message-ID: <89c863cc-1700-348d-85ac-0e8c3ced7a66@oracle.com> (raw)
In-Reply-To: <17d4c5c5-af74-c6d1-f05d-1c2078c2d6a@google.com>

On 11/1/21 12:01 AM, Hugh Dickins wrote:
> On Sat, 9 Oct 2021, zhangyiru wrote:
>>  fs/hugetlbfs/inode.c | 7 +++----
>>  1 file changed, 3 insertions(+), 4 deletions(-)
> 
> I have nothing against the obsoletion itself;
> but this patch appears to be incorrect, and far from complete.
> 
> Incorrect (unless we actually want to *punish* those who still use
> deprecated interfaces) because in these latest versions, it consumes
> from the mlock ulimit (if use_shm_lock() succeeds), but never gives
> back what it consumed.  I don't see why user_shm_lock() is called.

Thanks Hugh!

I was so focused on how how this might impact people still using the
deprecated feature, I missed this.

Since I have seen the 'this is deprecated' message as recently as this
year, I suspect this will impact someone.  The way it will impact them
is that their application will no longer work due to shmget() failing.
This is why it would be good idea to at least log a message saying someone
tried to use the obsolete feature.

The most convenient way to  determine if the call would have succeeded due
to the obsolete feature, is by using the existing user_shm_lock/unlock calls.
I suppose we could create a separate routine to just check the limit so that
a message can be printed.  Or, possibly open code.  But, I would advocate
for removing the 'this is obsolete' message in the next release.  When
we remove the message, we can eliminate the calls to user_shm_lock/unlock.

-- 
Mike Kravetz


      parent reply	other threads:[~2021-11-01 21:39 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-09  9:43 zhangyiru
2021-10-11 21:39 ` Mike Kravetz
2021-11-01  7:01 ` Hugh Dickins
2021-11-01 19:44   ` [PATCH v5] " zhangyiru
2021-11-01 21:09     ` [PATCH v6] " zhangyiru
2021-11-01 23:05       ` Mike Kravetz
2021-11-02 15:40         ` [PATCH v7] " zhangyiru
2021-11-02 19:46           ` Mike Kravetz
2021-11-03 10:58             ` [PATCH v8] " zhangyiru
2021-11-03 17:19               ` Mike Kravetz
2021-11-01 21:39   ` Mike Kravetz [this message]

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=89c863cc-1700-348d-85ac-0e8c3ced7a66@oracle.com \
    --to=mike.kravetz@oracle.com \
    --cc=akpm@linux-foundation.org \
    --cc=hughd@google.com \
    --cc=linux-mm@kvack.org \
    --cc=liusirui@huawei.com \
    --cc=liuzixian4@huawei.com \
    --cc=mhocko@suse.com \
    --cc=wuxu.wu@huawei.com \
    --cc=zhangyiru3@huawei.com \
    /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