Skip to contentSkip to conversation

mm, hugetlb: remove ulimit restriction for SHM_HUGETLB

PATCH Superseded zhangyiru 1 participant 1 message Aug 30, 2021

Subsystems (2)

v1 of 8 Superseded Latest is v8 →

lore
Share & tools
lore

zhangyiru

author
#0 lore raw

PATCH 1/1 mm, hugetlb: remove ulimit restriction for SHM_HUGETLB

remove mlock ulimit for SHM_HUGETLB
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

---
 fs/hugetlbfs/inode.c | 14 ++------------
 1 file changed, 2 insertions(+), 12 deletions(-)
fs/hugetlbfs/inode.c +2 -12
index cdfb1ae78a3f..c092c4931c3e 100644
@@ -1463,18 +1463,8 @@ struct file *hugetlb_file_setup(const char *name, size_t size,
 	if (!mnt)
 		return ERR_PTR(-ENOENT);
 
-	if (creat_flags == HUGETLB_SHMFS_INODE && !can_do_hugetlb_shm()) {
-		*ucounts = current_ucounts();
-		if (user_shm_lock(size, *ucounts)) {
-			task_lock(current);
-			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);
-		}
-	}
+	if (creat_flags == HUGETLB_SHMFS_INODE && !can_do_hugetlb_shm())
+		return ERR_PTR(-EPERM);
 
 	file = ERR_PTR(-ENOSPC);
 	inode = hugetlbfs_get_inode(mnt->mnt_sb, NULL, S_IFREG | S_IRWXUGO, 0);
Signature · 1 line
2.27.0