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=-8.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,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 50EE5C433E2 for ; Wed, 9 Sep 2020 09:33:55 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 58E2221D79 for ; Wed, 9 Sep 2020 09:33:54 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=ibm.com header.i=@ibm.com header.b="Jrfn9/c4" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 58E2221D79 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=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 7AA266B0068; Wed, 9 Sep 2020 05:33:53 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 75A8B6B006C; Wed, 9 Sep 2020 05:33:53 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 6225E6B006E; Wed, 9 Sep 2020 05:33:53 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0183.hostedemail.com [216.40.44.183]) by kanga.kvack.org (Postfix) with ESMTP id 4CF336B0068 for ; Wed, 9 Sep 2020 05:33:53 -0400 (EDT) Received: from smtpin28.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 0901D824805A for ; Wed, 9 Sep 2020 09:33:53 +0000 (UTC) X-FDA: 77243011146.28.fruit05_2c0ccc0270dc Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin28.hostedemail.com (Postfix) with ESMTP id C95B4F031 for ; Wed, 9 Sep 2020 09:33:52 +0000 (UTC) X-HE-Tag: fruit05_2c0ccc0270dc X-Filterd-Recvd-Size: 5711 Received: from mx0a-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) by imf38.hostedemail.com (Postfix) with ESMTP for ; Wed, 9 Sep 2020 09:33:52 +0000 (UTC) Received: from pps.filterd (m0098413.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 0899X4bm015662; Wed, 9 Sep 2020 05:33:50 -0400 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=1c4mbqTzqzCmgGuR4293Re4zs3byhVY8MStQAuq9a+U=; b=Jrfn9/c4nSkWpgl3ijTVc4PMqgCkGwt4GUamCF9hP3X3I+yM45EudqNNgJgQh2tY7i4Z cUgT7v1oiCn5e8L45RbvzgFaynD/8vj+C1/kCKKzH1Wz5P5d0aTBPY0ZWWfMQKOYlIjz TBZNDYY1VD723eswPgJcDpXgy7/3Sd/rtoUpb1oNL5bcQ/Qgzq6PYicirPWm8BSIo8HS 3elGlHI7vnQY9zcnyi/9rpyZqHy3dZE3yH0pFKR/cf5k2TMdIROOdiQDR8I4yuY1+8qj CVeG6kKtaS/L/jrQcM+flX53VjG/ICg3prXj6XH1tu3YNqOgKda6DlFptw7thrLmLgJt CQ== Received: from pps.reinject (localhost [127.0.0.1]) by mx0b-001b2d01.pphosted.com with ESMTP id 33eq25t87k-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 09 Sep 2020 05:33:49 -0400 Received: from m0098413.ppops.net (m0098413.ppops.net [127.0.0.1]) by pps.reinject (8.16.0.36/8.16.0.36) with SMTP id 0899X88s016233; Wed, 9 Sep 2020 05:33:08 -0400 Received: from ppma04ams.nl.ibm.com (63.31.33a9.ip4.static.sl-reverse.com [169.51.49.99]) by mx0b-001b2d01.pphosted.com with ESMTP id 33eq25t7ys-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 09 Sep 2020 05:33:08 -0400 Received: from pps.filterd (ppma04ams.nl.ibm.com [127.0.0.1]) by ppma04ams.nl.ibm.com (8.16.0.42/8.16.0.42) with SMTP id 0899RBB3011790; Wed, 9 Sep 2020 09:32:47 GMT Received: from b06cxnps3075.portsmouth.uk.ibm.com (d06relay10.portsmouth.uk.ibm.com [9.149.109.195]) by ppma04ams.nl.ibm.com with ESMTP id 33c2a8cbe8-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 09 Sep 2020 09:32:47 +0000 Received: from d06av22.portsmouth.uk.ibm.com (d06av22.portsmouth.uk.ibm.com [9.149.105.58]) by b06cxnps3075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 0899Winf27591064 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 9 Sep 2020 09:32:44 GMT Received: from d06av22.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 86A9F4C04E; Wed, 9 Sep 2020 09:32:44 +0000 (GMT) Received: from d06av22.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id E7DF44C046; Wed, 9 Sep 2020 09:32:43 +0000 (GMT) Received: from pomme.local (unknown [9.145.19.60]) by d06av22.portsmouth.uk.ibm.com (Postfix) with ESMTP; Wed, 9 Sep 2020 09:32:43 +0000 (GMT) Subject: Re: [PATCH] mm: don't rely on system state to detect hot-plug operations To: David Hildenbrand , Michal Hocko Cc: akpm@linux-foundation.org, Oscar Salvador , rafael@kernel.org, nathanl@linux.ibm.com, cheloha@linux.ibm.com, stable@vger.kernel.org, Greg Kroah-Hartman , linux-mm@kvack.org, LKML References: <5cbd92e1-c00a-4253-0119-c872bfa0f2bc@redhat.com> <20200908170835.85440-1-ldufour@linux.ibm.com> <20200909074011.GD7348@dhcp22.suse.cz> <9faac1ce-c02d-7dbc-f79a-4aaaa5a73d28@linux.ibm.com> <20200909090953.GE7348@dhcp22.suse.cz> <4cdb54be-1a92-4ba4-6fee-3b415f3468a9@linux.ibm.com> <9ad553f2-ebbf-cae5-5570-f60d2c965c41@redhat.com> From: Laurent Dufour Message-ID: <23a9ab54-a7bf-5bc2-2a60-e8a1246ed537@linux.ibm.com> Date: Wed, 9 Sep 2020 11:32:43 +0200 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:68.0) Gecko/20100101 Thunderbird/68.12.0 MIME-Version: 1.0 In-Reply-To: <9ad553f2-ebbf-cae5-5570-f60d2c965c41@redhat.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US X-TM-AS-GCONF: 00 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.235,18.0.687 definitions=2020-09-09_03:2020-09-08,2020-09-09 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 lowpriorityscore=0 mlxscore=0 mlxlogscore=999 malwarescore=0 clxscore=1015 adultscore=0 priorityscore=1501 bulkscore=0 suspectscore=0 impostorscore=0 phishscore=0 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2006250000 definitions=main-2009090081 X-Rspamd-Queue-Id: C95B4F031 X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam03 Content-Transfer-Encoding: quoted-printable 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: Le 09/09/2020 =C3=A0 11:24, David Hildenbrand a =C3=A9crit=C2=A0: >>> I am not sure an enum is going to make the existing situation less >>> messy. Sure we somehow have to distinguish boot init and runtime hotp= lug >>> because they have different constrains. I am arguing that a) we shoul= d >>> have a consistent way to check for those and b) we shouldn't blow up >>> easily just because sysfs infrastructure has failed to initialize. >> >> For the point a, using the enum allows to know in register_mem_sect_un= der_node() >> if the link operation is due to a hotplug operation or done at boot ti= me. >> >> For the point b, one option would be ignore the link error in the case= the link >> is already existing, but that BUG_ON() had the benefit to highlight th= e root issue. >> >=20 > WARN_ON_ONCE() would be preferred - not crash the system but still > highlight the issue. Indeed, calling sysfs_create_link() instead of sysfs_create_link_nowarn()= in=20 register_mem_sect_under_node() and ignoring EEXIST returned value should = do the job. I'll do that in a separate patch.