From patchwork Sat Oct 9 09:43:55 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: zhangyiru X-Patchwork-Id: 12546843 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 80B14C433EF for ; Sat, 9 Oct 2021 01:44:00 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 24F336103C for ; Sat, 9 Oct 2021 01:44:00 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 24F336103C Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=huawei.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id 77BB56B0071; Fri, 8 Oct 2021 21:43:59 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 72B4D6B0072; Fri, 8 Oct 2021 21:43:59 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 61A736B0073; Fri, 8 Oct 2021 21:43:59 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0068.hostedemail.com [216.40.44.68]) by kanga.kvack.org (Postfix) with ESMTP id 543446B0071 for ; Fri, 8 Oct 2021 21:43:59 -0400 (EDT) Received: from smtpin13.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id 174BF39F22 for ; Sat, 9 Oct 2021 01:43:59 +0000 (UTC) X-FDA: 78675202998.13.FF326C9 Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by imf07.hostedemail.com (Postfix) with ESMTP id 5064D1002AD0 for ; Sat, 9 Oct 2021 01:43:58 +0000 (UTC) Received: from dggemv704-chm.china.huawei.com (unknown [172.30.72.57]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4HR7585pzPz8yC3; Sat, 9 Oct 2021 09:39:08 +0800 (CST) Received: from dggpemm500012.china.huawei.com (7.185.36.89) by dggemv704-chm.china.huawei.com (10.3.19.47) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.8; Sat, 9 Oct 2021 09:43:55 +0800 Received: from huawei.com (10.175.104.170) by dggpemm500012.china.huawei.com (7.185.36.89) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.8; Sat, 9 Oct 2021 09:43:54 +0800 From: zhangyiru To: , CC: , , , , , Subject: [PATCH v4] mm,hugetlb: remove mlock ulimit for SHM_HUGETLB Date: Sat, 9 Oct 2021 05:43:55 -0400 Message-ID: <20211009094355.127705-1-zhangyiru3@huawei.com> X-Mailer: git-send-email 2.27.0 MIME-Version: 1.0 X-Originating-IP: [10.175.104.170] X-ClientProxiedBy: dggems703-chm.china.huawei.com (10.3.19.180) To dggpemm500012.china.huawei.com (7.185.36.89) X-CFilter-Loop: Reflected Authentication-Results: imf07.hostedemail.com; dkim=none; dmarc=pass (policy=none) header.from=huawei.com; spf=pass (imf07.hostedemail.com: domain of zhangyiru3@huawei.com designates 45.249.212.188 as permitted sender) smtp.mailfrom=zhangyiru3@huawei.com X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: 5064D1002AD0 X-Stat-Signature: 3ut4yfbhnofh95hju84xd7huxh79mikg X-HE-Tag: 1633743838-531017 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: 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 Reviewed-by: Mike Kravetz --- Changelog: v4: modify context information of obsolete v3: modify warning message to obsolete v2: preserve warning message v1: remove mlock ulimit for SHM_HUGETLB --- fs/hugetlbfs/inode.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/fs/hugetlbfs/inode.c b/fs/hugetlbfs/inode.c index cdfb1ae78a3f..5ff3418759ed 100644 --- a/fs/hugetlbfs/inode.c +++ b/fs/hugetlbfs/inode.c @@ -1467,13 +1467,12 @@ struct file *hugetlb_file_setup(const char *name, size_t size, *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", + pr_warn_once("%s (%d): Using mlock ulimits for SHM_HUGETLB is obsolete\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);