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=-2.5 required=3.0 tests=MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=no 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 101C7C432C2 for ; Thu, 26 Sep 2019 11:53:02 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id D0E162053B for ; Thu, 26 Sep 2019 11:53:01 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D0E162053B Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 7D7FA6B0006; Thu, 26 Sep 2019 07:53:01 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 760726B0008; Thu, 26 Sep 2019 07:53:01 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 676A96B000A; Thu, 26 Sep 2019 07:53:01 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0249.hostedemail.com [216.40.44.249]) by kanga.kvack.org (Postfix) with ESMTP id 3EFED6B0006 for ; Thu, 26 Sep 2019 07:53:01 -0400 (EDT) Received: from smtpin27.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with SMTP id CF38962E9 for ; Thu, 26 Sep 2019 11:53:00 +0000 (UTC) X-FDA: 75976910520.27.cow41_718ff2734e036 X-HE-Tag: cow41_718ff2734e036 X-Filterd-Recvd-Size: 2926 Received: from mx1.suse.de (mx2.suse.de [195.135.220.15]) by imf41.hostedemail.com (Postfix) with ESMTP for ; Thu, 26 Sep 2019 11:53:00 +0000 (UTC) X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 06525AEAC; Thu, 26 Sep 2019 11:52:58 +0000 (UTC) Date: Thu, 26 Sep 2019 13:52:58 +0200 From: Michal Hocko To: Qian Cai Cc: David Hildenbrand , linux-kernel@vger.kernel.org, linux-mm@kvack.org, Andrew Morton , Oscar Salvador , Pavel Tatashin , Dan Williams , Thomas Gleixner Subject: Re: [PATCH v1] mm/memory_hotplug: Don't take the cpu_hotplug_lock Message-ID: <20190926115258.GH20255@dhcp22.suse.cz> References: <20190926072645.GA20255@dhcp22.suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) 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: On Thu 26-09-19 07:19:27, Qian Cai wrote: > > > > On Sep 26, 2019, at 3:26 AM, Michal Hocko wrote: > > > > OK, this is using for_each_online_cpu but why is this a problem? Have > > you checked what the code actually does? Let's say that online_pages is > > racing with cpu hotplug. A new CPU appears/disappears from the online > > mask while we are iterating it, right? Let's start with cpu offlining > > case. We have two choices, either the cpu is still visible and we update > > its local node configuration even though it will disappear shortly which > > is ok because we are not touching any data that disappears (it's all > > per-cpu). Case when the cpu is no longer there is not really > > interesting. For the online case we might miss a cpu but that should be > > tolerateable because that is not any different from triggering the > > online independently of the memory hotplug. So there has to be a hook > > from that code path as well. If there is none then this is buggy > > irrespective of the locking. > > > > Makes sense? > > This sounds to me requires lots of audits and testing. Also, someone who is more > familiar with CPU hotplug should review this patch. Thomas is on the CC list. > Personally, I am no fun of > operating on an incorrect CPU mask to begin with, things could go wrong really > quickly... Do you have any specific arguments? Just think of cpu and memory hotplugs being independent operations. There is nothing really inherently binding them together. If the cpu_online_mask really needs a special treatment here then I would like to hear about that. Handwaving doesn't really helps us. -- Michal Hocko SUSE Labs