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=-0.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS 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 0F53DC432C2 for ; Thu, 26 Sep 2019 11:19:31 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id C424E222C3 for ; Thu, 26 Sep 2019 11:19:30 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lca.pw header.i=@lca.pw header.b="FDwis0Me" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C424E222C3 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=lca.pw Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 531576B0006; Thu, 26 Sep 2019 07:19:30 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 4E1C76B0008; Thu, 26 Sep 2019 07:19:30 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 3D0AC6B000A; Thu, 26 Sep 2019 07:19:30 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0229.hostedemail.com [216.40.44.229]) by kanga.kvack.org (Postfix) with ESMTP id 15AB06B0006 for ; Thu, 26 Sep 2019 07:19:30 -0400 (EDT) Received: from smtpin30.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with SMTP id B29DF87CB for ; Thu, 26 Sep 2019 11:19:29 +0000 (UTC) X-FDA: 75976826058.30.arm93_6ff524638d90d X-HE-Tag: arm93_6ff524638d90d X-Filterd-Recvd-Size: 4450 Received: from mail-qt1-f195.google.com (mail-qt1-f195.google.com [209.85.160.195]) by imf36.hostedemail.com (Postfix) with ESMTP for ; Thu, 26 Sep 2019 11:19:29 +0000 (UTC) Received: by mail-qt1-f195.google.com with SMTP id u22so2293109qtq.13 for ; Thu, 26 Sep 2019 04:19:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=lca.pw; s=google; h=content-transfer-encoding:from:mime-version:subject:date:message-id :references:cc:in-reply-to:to; bh=fYPToXR0NbT6CEGxTuAqdgHd5+edDYqh00rkxBfwc+g=; b=FDwis0Men9NI9YQN4z3fTSsiW3WRxGnkwpSNIUznkIm9T9QlUki5GrSyFpzt0k9IxA /wZ/ZBxP8iTaECWgBw33oNZfTxFbQEnW1FtPGpCaSAOCF8pnITk0E5QFliWObZ1CLjdX tpIUvr1OsnhE+cK8rRx+MtEopb0zkDjFOtdIeulag7FO6DO3+GlUV/C6LCNrQ9D4ePfA uiksPXhP+iH+cP9/pg0g4tP0zxRrG5ZNqlUWavoAX4K8s6iCeAuLfMwmx7R8nUoSYGVJ 8uCjyWHijpa8ZPr8Ex93VILlJU8A3/jAu3NyWQNi2YPSR2iUhv16hk7CzyXChdGfiQlz qrog== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:content-transfer-encoding:from:mime-version :subject:date:message-id:references:cc:in-reply-to:to; bh=fYPToXR0NbT6CEGxTuAqdgHd5+edDYqh00rkxBfwc+g=; b=qCpenAR5oTnJygGwZm5+BCMUM2l/xfo6FaTESf2w/DaJn+P+grfRtkcX0SivTd3Pfd clzqXPZ5KqhSoY8zxQrnAQmRhDRZPgggIpVWhGnCYhcG0+OtMohHdbwuH7FtVHqpo8cP 9zJwsVApy/8ww3zM/ZpPFudwrILxyTzMctClC9FBrlSVTtAUG0yMyT4BQ89HjdMOgz4P ZGe2ALhBvYqcUcCF3Vdl9QfoWneEXZ9d3yH/x1z8AGwfyOOn8VB57Kk/0ggU4SWKcswc 17UO3aB8MJKHdGW5alznd+FFcdC+4c1WazsG/FqKXMmgWVKlsEEXlPc79euQSx0lmgyb V4HQ== X-Gm-Message-State: APjAAAXT+M07EmhPh6VrFk3zkPy6i4T4nessN16KY0xPIdp+oS4W63/D IUDAFQzZG8IW+xGYOJ79/BCp1g== X-Google-Smtp-Source: APXvYqwV2ycsL7eT1GE5Ae675yE7aehFn4ca0zlLCKzexIiFu9hFxuG6zLao80D35lhl4n5Uxk+M5g== X-Received: by 2002:ac8:41ca:: with SMTP id o10mr3194278qtm.352.1569496768610; Thu, 26 Sep 2019 04:19:28 -0700 (PDT) Received: from [192.168.1.183] (pool-71-184-117-43.bstnma.fios.verizon.net. [71.184.117.43]) by smtp.gmail.com with ESMTPSA id 63sm875654qkh.82.2019.09.26.04.19.27 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 26 Sep 2019 04:19:28 -0700 (PDT) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable From: Qian Cai Mime-Version: 1.0 (1.0) Subject: Re: [PATCH v1] mm/memory_hotplug: Don't take the cpu_hotplug_lock Date: Thu, 26 Sep 2019 07:19:27 -0400 Message-Id: References: <20190926072645.GA20255@dhcp22.suse.cz> Cc: David Hildenbrand , linux-kernel@vger.kernel.org, linux-mm@kvack.org, Andrew Morton , Oscar Salvador , Pavel Tatashin , Dan Williams , Thomas Gleixner In-Reply-To: <20190926072645.GA20255@dhcp22.suse.cz> To: Michal Hocko X-Mailer: iPhone Mail (17A844) 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 Sep 26, 2019, at 3:26 AM, Michal Hocko wrote: >=20 > 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. >=20 > Makes sense? This sounds to me requires lots of audits and testing. Also, someone who is m= ore familiar with CPU hotplug should review this patch. Personally, I am no fun o= f operating on an incorrect CPU mask to begin with, things could go wrong real= ly quickly...=