From patchwork Fri Jun 10 13:52:19 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Aneesh Kumar K.V" X-Patchwork-Id: 12877623 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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 44B5BC433EF for ; Fri, 10 Jun 2022 13:53:30 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id CC6438D00A6; Fri, 10 Jun 2022 09:53:29 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id C4F928D009C; Fri, 10 Jun 2022 09:53:29 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id AA0988D00A6; Fri, 10 Jun 2022 09:53:29 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id 97E2C8D009C for ; Fri, 10 Jun 2022 09:53:29 -0400 (EDT) Received: from smtpin17.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay12.hostedemail.com (Postfix) with ESMTP id 78E91120364 for ; Fri, 10 Jun 2022 13:53:29 +0000 (UTC) X-FDA: 79562468538.17.964ECE5 Received: from mx0b-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) by imf24.hostedemail.com (Postfix) with ESMTP id 0AA6918006B for ; Fri, 10 Jun 2022 13:53:28 +0000 (UTC) Received: from pps.filterd (m0098421.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 25ADY1Ng023578; Fri, 10 Jun 2022 13:53:19 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding; s=pp1; bh=yPR26Ihb5In/eBRJL5MvPvXGtjwasSeSjglyfb726gs=; b=ZKHw0n+smFHRl03cPO2F3oz5SOGE4UnVoSB8UQVZHtkRY6hA7vVFcvDHyK8Db2Aalnd1 F8kZ80N2zxGSdINtk0cIEJj87krEZLn/RZoEPvj4lioZgqPnUfxwKzc6tm7CuFqoQuVe f+p30c//uf8SkEitMaqX+lRz28fEjq3oXfUP9TqGl3RHToKtXVrWBuWJcRP4Cl0Z7FVF b6UiK59RgQkfTvUS1CZs65sWS30WmVevxXHNoEooOSkZuoV3H8Hdo/A9y1NqjhUsPvPa qBOrm5q3s/1GYRHdgxXXP+NvOHpaKdKms8BfhT9QL0GkytzDeJ/IdrumjVxWtVV1SPXs Lw== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3gm6y18c63-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 10 Jun 2022 13:53:19 +0000 Received: from m0098421.ppops.net (m0098421.ppops.net [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 25ADYL7r024660; Fri, 10 Jun 2022 13:53:18 GMT Received: from ppma01dal.us.ibm.com (83.d6.3fa9.ip4.static.sl-reverse.com [169.63.214.131]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3gm6y18c5r-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 10 Jun 2022 13:53:18 +0000 Received: from pps.filterd (ppma01dal.us.ibm.com [127.0.0.1]) by ppma01dal.us.ibm.com (8.16.1.2/8.16.1.2) with SMTP id 25ADajLP022273; Fri, 10 Jun 2022 13:53:17 GMT Received: from b03cxnp07029.gho.boulder.ibm.com (b03cxnp07029.gho.boulder.ibm.com [9.17.130.16]) by ppma01dal.us.ibm.com with ESMTP id 3gfy1au6xr-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 10 Jun 2022 13:53:17 +0000 Received: from b03ledav003.gho.boulder.ibm.com (b03ledav003.gho.boulder.ibm.com [9.17.130.234]) by b03cxnp07029.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 25ADrGAY29688300 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 10 Jun 2022 13:53:16 GMT Received: from b03ledav003.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id EA9946A04D; Fri, 10 Jun 2022 13:53:15 +0000 (GMT) Received: from b03ledav003.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 244A16A047; Fri, 10 Jun 2022 13:53:07 +0000 (GMT) Received: from skywalker.ibmuc.com (unknown [9.43.90.151]) by b03ledav003.gho.boulder.ibm.com (Postfix) with ESMTP; Fri, 10 Jun 2022 13:53:06 +0000 (GMT) From: "Aneesh Kumar K.V" To: linux-mm@kvack.org, akpm@linux-foundation.org Cc: Wei Xu , Huang Ying , Greg Thelen , Yang Shi , Davidlohr Bueso , Tim C Chen , Brice Goglin , Michal Hocko , Linux Kernel Mailing List , Hesham Almatary , Dave Hansen , Jonathan Cameron , Alistair Popple , Dan Williams , Feng Tang , Jagdish Gediya , Baolin Wang , David Rientjes , "Aneesh Kumar K.V" Subject: [PATCH v6 03/13] mm/demotion: Return error on write to numa_demotion sysfs Date: Fri, 10 Jun 2022 19:22:19 +0530 Message-Id: <20220610135229.182859-4-aneesh.kumar@linux.ibm.com> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220610135229.182859-1-aneesh.kumar@linux.ibm.com> References: <20220610135229.182859-1-aneesh.kumar@linux.ibm.com> MIME-Version: 1.0 X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: drQcqWUdOmdTlhuQbKaznMGhlmFljSWF X-Proofpoint-GUID: Pngpu4I6nekQyZNkdZTgN9KAaEuAoPew X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.874,Hydra:6.0.517,FMLib:17.11.64.514 definitions=2022-06-10_06,2022-06-09_02,2022-02-23_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 suspectscore=0 spamscore=0 bulkscore=0 malwarescore=0 impostorscore=0 lowpriorityscore=0 phishscore=0 mlxlogscore=999 mlxscore=0 adultscore=0 priorityscore=1501 clxscore=1015 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2204290000 definitions=main-2206100052 ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1654869209; a=rsa-sha256; cv=none; b=UjTPy1+/dFCPqKxWgQMGjubBJEbsjA4/S8MY1RdziRKYt9qbqtyJxWjSENAKKC+6tXNBHt l9lBW3B3lNaIO5zX0A6SOmtvvNA4atjVaMPLM6SjC0JdQwRaGp8SXsoNpfa2TGnmluherW rYb2AsUP6kIgMIyw3P8/qr5MY/GZbr8= ARC-Authentication-Results: i=1; imf24.hostedemail.com; dkim=pass header.d=ibm.com header.s=pp1 header.b=ZKHw0n+s; spf=pass (imf24.hostedemail.com: domain of aneesh.kumar@linux.ibm.com designates 148.163.158.5 as permitted sender) smtp.mailfrom=aneesh.kumar@linux.ibm.com; dmarc=pass (policy=none) header.from=ibm.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1654869209; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=yPR26Ihb5In/eBRJL5MvPvXGtjwasSeSjglyfb726gs=; b=tUJe+YbnlWXq19kfv8Tt00r3Zz84yLVN9DVz19anRdC/WvtTjVm5dWe2M2h52n4fN9/l6K 3tEuB02Kd40R+A+JCXAqc2zYJNMTyU6TF+n5PTC/ZDAj6bC1d+sRkPNzXxuMMrq9KNZl2k ZwypU73JCAMzNMVVk698grIsMRaWNPc= X-Rspamd-Server: rspam09 X-Rspamd-Queue-Id: 0AA6918006B X-Stat-Signature: fwt9uu43ios9w11t73sr9faana66iozj X-Rspam-User: Authentication-Results: imf24.hostedemail.com; dkim=pass header.d=ibm.com header.s=pp1 header.b=ZKHw0n+s; spf=pass (imf24.hostedemail.com: domain of aneesh.kumar@linux.ibm.com designates 148.163.158.5 as permitted sender) smtp.mailfrom=aneesh.kumar@linux.ibm.com; dmarc=pass (policy=none) header.from=ibm.com X-HE-Tag: 1654869208-190716 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: With CONFIG_MIGRATION disabled return EINVAL on write. Signed-off-by: Aneesh Kumar K.V --- mm/memory-tiers.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/mm/memory-tiers.c b/mm/memory-tiers.c index 9c6b40d7e0bf..c3123a457d90 100644 --- a/mm/memory-tiers.c +++ b/mm/memory-tiers.c @@ -105,6 +105,9 @@ static ssize_t numa_demotion_enabled_store(struct kobject *kobj, { ssize_t ret; + if (!IS_ENABLED(CONFIG_MIGRATION)) + return -EINVAL; + ret = kstrtobool(buf, &numa_demotion_enabled); if (ret) return ret;