linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH RESEND v2] mm,hugetlb: remove mlock ulimit for SHM_HUGETLB
@ 2021-10-08 19:57 zhangyiru
  2021-10-08 21:26 ` Mike Kravetz
  0 siblings, 1 reply; 3+ messages in thread
From: zhangyiru @ 2021-10-08 19:57 UTC (permalink / raw)
  To: mike.kravetz, akpm; +Cc: linux-mm, mhocko, wuxu.wu, liusirui, liuzixian4

commit 21a3c273f88c9cbbaf7e ("mm, hugetlb: add thread name and pid to
SHM_HUGETLB mlock rlimit warning") marked this as deprecated in 2012,
but it is not deleted yet.

Mike says he still see that message in log files on occasion,
so maybe we should preserve this warning.

Signed-off-by: zhangyiru <zhangyiru3@huawei.com>
---
Changelog:
 v2: preserve warning message
 v1: remove mlock ulimit for SHM_HUGETLB
---
 fs/hugetlbfs/inode.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/fs/hugetlbfs/inode.c b/fs/hugetlbfs/inode.c
index cdfb1ae78a3f..877d0ce9526c 100644
--- a/fs/hugetlbfs/inode.c
+++ b/fs/hugetlbfs/inode.c
@@ -1470,10 +1470,9 @@ struct file *hugetlb_file_setup(const char *name, size_t size,
 			pr_warn_once("%s (%d): Using mlock ulimits for SHM_HUGETLB is deprecated\n",
 				current->comm, current->pid);
 			task_unlock(current);
-		} else {
-			*ucounts = NULL;
-			return ERR_PTR(-EPERM);
 		}
+		*ucounts = NULL;
+		return ERR_PTR(-EPERM);
 	}
 
 	file = ERR_PTR(-ENOSPC);
-- 
2.27.0



^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH RESEND v2] mm,hugetlb: remove mlock ulimit for SHM_HUGETLB
  2021-10-08 19:57 [PATCH RESEND v2] mm,hugetlb: remove mlock ulimit for SHM_HUGETLB zhangyiru
@ 2021-10-08 21:26 ` Mike Kravetz
  2021-10-11  8:28   ` Michal Hocko
  0 siblings, 1 reply; 3+ messages in thread
From: Mike Kravetz @ 2021-10-08 21:26 UTC (permalink / raw)
  To: zhangyiru, akpm; +Cc: linux-mm, mhocko, wuxu.wu, liusirui, liuzixian4

On 10/8/21 12:57 PM, zhangyiru wrote:
> commit 21a3c273f88c9cbbaf7e ("mm, hugetlb: add thread name and pid to
> SHM_HUGETLB mlock rlimit warning") marked this as deprecated in 2012,
> but it is not deleted yet.
> 
> Mike says he still see that message in log files on occasion,
> so maybe we should preserve this warning.
> 
> Signed-off-by: zhangyiru <zhangyiru3@huawei.com>
> ---
> Changelog:
>  v2: preserve warning message
>  v1: remove mlock ulimit for SHM_HUGETLB
> ---
>  fs/hugetlbfs/inode.c | 5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)
> 
> diff --git a/fs/hugetlbfs/inode.c b/fs/hugetlbfs/inode.c
> index cdfb1ae78a3f..877d0ce9526c 100644
> --- a/fs/hugetlbfs/inode.c
> +++ b/fs/hugetlbfs/inode.c
> @@ -1470,10 +1470,9 @@ struct file *hugetlb_file_setup(const char *name, size_t size,
>  			pr_warn_once("%s (%d): Using mlock ulimits for SHM_HUGETLB is deprecated\n",
>  				current->comm, current->pid);
>  			task_unlock(current);
> -		} else {
> -			*ucounts = NULL;
> -			return ERR_PTR(-EPERM);
>  		}
> +		*ucounts = NULL;
> +		return ERR_PTR(-EPERM);

IIUC, deprecated means that use of the feature is discouraged but
technically still available.  With this patch, we use the term
deprecated and also remove the functionality.  Perhaps change the
warning to be the following?

pr_warn_once("%s (%d): Using mlock ulimits for SHM_HUGETLB is now obsolete\n",

Leaving the 'deprecated' message and removing the functionality may
confuse people if their application breaks after this patch.
-- 
Mike Kravetz


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH RESEND v2] mm,hugetlb: remove mlock ulimit for SHM_HUGETLB
  2021-10-08 21:26 ` Mike Kravetz
@ 2021-10-11  8:28   ` Michal Hocko
  0 siblings, 0 replies; 3+ messages in thread
From: Michal Hocko @ 2021-10-11  8:28 UTC (permalink / raw)
  To: Mike Kravetz; +Cc: zhangyiru, akpm, linux-mm, wuxu.wu, liusirui, liuzixian4

On Fri 08-10-21 14:26:48, Mike Kravetz wrote:
> On 10/8/21 12:57 PM, zhangyiru wrote:
> > commit 21a3c273f88c9cbbaf7e ("mm, hugetlb: add thread name and pid to
> > SHM_HUGETLB mlock rlimit warning") marked this as deprecated in 2012,
> > but it is not deleted yet.
> > 
> > Mike says he still see that message in log files on occasion,
> > so maybe we should preserve this warning.
> > 
> > Signed-off-by: zhangyiru <zhangyiru3@huawei.com>
> > ---
> > Changelog:
> >  v2: preserve warning message
> >  v1: remove mlock ulimit for SHM_HUGETLB
> > ---
> >  fs/hugetlbfs/inode.c | 5 ++---
> >  1 file changed, 2 insertions(+), 3 deletions(-)
> > 
> > diff --git a/fs/hugetlbfs/inode.c b/fs/hugetlbfs/inode.c
> > index cdfb1ae78a3f..877d0ce9526c 100644
> > --- a/fs/hugetlbfs/inode.c
> > +++ b/fs/hugetlbfs/inode.c
> > @@ -1470,10 +1470,9 @@ struct file *hugetlb_file_setup(const char *name, size_t size,
> >  			pr_warn_once("%s (%d): Using mlock ulimits for SHM_HUGETLB is deprecated\n",
> >  				current->comm, current->pid);
> >  			task_unlock(current);
> > -		} else {
> > -			*ucounts = NULL;
> > -			return ERR_PTR(-EPERM);
> >  		}
> > +		*ucounts = NULL;
> > +		return ERR_PTR(-EPERM);
> 
> IIUC, deprecated means that use of the feature is discouraged but
> technically still available.  With this patch, we use the term
> deprecated and also remove the functionality.  Perhaps change the
> warning to be the following?
> 
> pr_warn_once("%s (%d): Using mlock ulimits for SHM_HUGETLB is now obsolete\n",

Agreed. I would even go with an addition "Please report if you have a
usecase for this functionality."

> Leaving the 'deprecated' message and removing the functionality may
> confuse people if their application breaks after this patch.
> -- 
> Mike Kravetz

-- 
Michal Hocko
SUSE Labs


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-10-11  8:28 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-08 19:57 [PATCH RESEND v2] mm,hugetlb: remove mlock ulimit for SHM_HUGETLB zhangyiru
2021-10-08 21:26 ` Mike Kravetz
2021-10-11  8:28   ` Michal Hocko

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).