From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.1 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 26D07C433E0 for ; Thu, 11 Mar 2021 07:47:05 +0000 (UTC) Received: from lists.ozlabs.org (lists.ozlabs.org [112.213.38.117]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 1FAAA64FD4 for ; Thu, 11 Mar 2021 07:47:03 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 1FAAA64FD4 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linux.ibm.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Received: from boromir.ozlabs.org (localhost [IPv6:::1]) by lists.ozlabs.org (Postfix) with ESMTP id 4Dx1HV0nxGz3cKT for ; Thu, 11 Mar 2021 18:47:02 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=ibm.com header.i=@ibm.com header.a=rsa-sha256 header.s=pp1 header.b=CmhgDmYp; dkim-atps=neutral Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=linux.ibm.com (client-ip=148.163.156.1; helo=mx0a-001b2d01.pphosted.com; envelope-from=fbarrat@linux.ibm.com; receiver=) Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=ibm.com header.i=@ibm.com header.a=rsa-sha256 header.s=pp1 header.b=CmhgDmYp; dkim-atps=neutral Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4Dx1H104Zyz2xb9 for ; Thu, 11 Mar 2021 18:46:36 +1100 (AEDT) Received: from pps.filterd (m0098394.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.43/8.16.0.43) with SMTP id 12B7Xsal019752; Thu, 11 Mar 2021 02:46:31 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=subject : to : cc : references : from : message-id : date : mime-version : in-reply-to : content-type : content-transfer-encoding; s=pp1; bh=h9ozpEMkB/v4fMTdKazSIT0NNUpl42ZAmNhWwboJc0A=; b=CmhgDmYptbNV96kMxZLtgC3iLxfB5rFn156ENA1YlY2BUD0GP+/xAR+bog03ofCuHska GcGz8o3pOMOmu1cxTigd84p1LzhIsZ1Rh4KwrCKAbURZ6JrNF04SOQBvDSGUGQkSOHXp OIsWa85NvCO1S3VO6Q8kDF+r98N4Pae/e/3qNeRImKShsxZXzZAcDOmYMdSTvL9rs9N5 kT0ZBMnYH+hrYSDpO1b3cAtkr49c8BnGy+sz9gKIxR7rb+pm/ZPcq8MJctrao6aBFu2K bJDEpYCgFWo0zHAvTBtYJW5wRMRUs9bmTvpNCI7hPCX9M4vkplWD8vE5lmRxixkOlnQO pg== Received: from ppma03ams.nl.ibm.com (62.31.33a9.ip4.static.sl-reverse.com [169.51.49.98]) by mx0a-001b2d01.pphosted.com with ESMTP id 3774m3ek7r-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 11 Mar 2021 02:46:30 -0500 Received: from pps.filterd (ppma03ams.nl.ibm.com [127.0.0.1]) by ppma03ams.nl.ibm.com (8.16.0.43/8.16.0.43) with SMTP id 12B7hp4s025602; Thu, 11 Mar 2021 07:46:28 GMT Received: from b06cxnps3074.portsmouth.uk.ibm.com (d06relay09.portsmouth.uk.ibm.com [9.149.109.194]) by ppma03ams.nl.ibm.com with ESMTP id 3768t4hpwc-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 11 Mar 2021 07:46:28 +0000 Received: from d06av23.portsmouth.uk.ibm.com (d06av23.portsmouth.uk.ibm.com [9.149.105.59]) by b06cxnps3074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 12B7kPRm38142260 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 11 Mar 2021 07:46:25 GMT Received: from d06av23.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 7EFC7A40C4; Thu, 11 Mar 2021 07:46:25 +0000 (GMT) Received: from d06av23.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 3EB14A40BF; Thu, 11 Mar 2021 07:46:25 +0000 (GMT) Received: from localhost.localdomain (unknown [9.145.67.65]) by d06av23.portsmouth.uk.ibm.com (Postfix) with ESMTP; Thu, 11 Mar 2021 07:46:25 +0000 (GMT) Subject: Re: [PATCH] cxl: don't manipulate the mm.mm_users field directly To: Laurent Dufour , ajd@linux.ibm.com, arnd@arndb.de, gregkh@linuxfoundation.org References: <20210310174405.51044-1-ldufour@linux.ibm.com> From: Frederic Barrat Message-ID: <8daa454c-b2fd-d914-b170-62b6665e82d8@linux.ibm.com> Date: Thu, 11 Mar 2021 08:46:25 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.8.0 MIME-Version: 1.0 In-Reply-To: <20210310174405.51044-1-ldufour@linux.ibm.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-TM-AS-GCONF: 00 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.369, 18.0.761 definitions=2021-03-11_02:2021-03-10, 2021-03-11 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 suspectscore=0 malwarescore=0 clxscore=1011 lowpriorityscore=0 bulkscore=0 impostorscore=0 priorityscore=1501 mlxlogscore=934 phishscore=0 spamscore=0 adultscore=0 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2103110041 X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: clombard@linux.ibm.com, linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org Errors-To: linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Sender: "Linuxppc-dev" On 10/03/2021 18:44, Laurent Dufour wrote: > It is better to rely on the API provided by the MM layer instead of > directly manipulating the mm_users field. > > Signed-off-by: Laurent Dufour > --- Thanks! Acked-by: Frederic Barrat > drivers/misc/cxl/fault.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/misc/cxl/fault.c b/drivers/misc/cxl/fault.c > index 01153b74334a..60c829113299 100644 > --- a/drivers/misc/cxl/fault.c > +++ b/drivers/misc/cxl/fault.c > @@ -200,7 +200,7 @@ static struct mm_struct *get_mem_context(struct cxl_context *ctx) > if (ctx->mm == NULL) > return NULL; > > - if (!atomic_inc_not_zero(&ctx->mm->mm_users)) > + if (!mmget_not_zero(ctx->mm)) > return NULL; > > return ctx->mm; >