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 37E9BC33CB1 for ; Fri, 17 Jan 2020 10:17:48 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 01D2B2072B for ; Fri, 17 Jan 2020 10:17:47 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 01D2B2072B 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 BE8EC6B0357; Fri, 17 Jan 2020 05:17:46 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id B98D66B0358; Fri, 17 Jan 2020 05:17:46 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id AAE546B0359; Fri, 17 Jan 2020 05:17:46 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0128.hostedemail.com [216.40.44.128]) by kanga.kvack.org (Postfix) with ESMTP id 967866B0357 for ; Fri, 17 Jan 2020 05:17:46 -0500 (EST) Received: from smtpin08.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with SMTP id 4064733C4 for ; Fri, 17 Jan 2020 10:17:46 +0000 (UTC) X-FDA: 76386724932.08.rice15_26b2885739411 X-HE-Tag: rice15_26b2885739411 X-Filterd-Recvd-Size: 4320 Received: from mail-wr1-f65.google.com (mail-wr1-f65.google.com [209.85.221.65]) by imf40.hostedemail.com (Postfix) with ESMTP for ; Fri, 17 Jan 2020 10:17:45 +0000 (UTC) Received: by mail-wr1-f65.google.com with SMTP id w15so22168829wru.4 for ; Fri, 17 Jan 2020 02:17:45 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=xrJxvLC7Z/aq3pNh/DrH8onU5ingWRht14zTkzqKmZo=; b=GhcRVT/jLWV/D9SmtOU9MJqXtDuOlytIZZanFMG55tC00/eWFU3h26euUl7KDP4J3J vvZaOfV0tqyCjiyxa3vyXDNXZ02pGiD+YwI/ECcOUFBx1MMjupaUWr+fPEn0t6Nk8z/Q /B8HKlRQTX/MId6MlqzoTPws/GMEgo3W/SlkYF4G9wYygW88GfnpSx6PtQ2fTeT7Tr3T JM/sxatyhwbOw27f9OU2gfPZwoTXDAKwx5eH/jhnzzLyEmcc8bYlixdq34H2KkPvGJQa VfE4HVmivqTeSLHi3vHC8Ela43+ZM8WY6dRfHlJweBWZjjB2MR+4rzEkT1fow7o35GJS FGqw== X-Gm-Message-State: APjAAAUORuQ0mhoBF3qRFBe8EHfh0Aal4u+DbgLGV/TA+d1rlaZ4OdRA VgzAObtMMTrR17nfW9MbJmk= X-Google-Smtp-Source: APXvYqw/9Ju3QNPOArhDuA/7fC6UkD4daXdr3tfG0dWNf1FgyI+rtjyzIPNWnW7nUK0JVYzpkHRGSw== X-Received: by 2002:a5d:4fd0:: with SMTP id h16mr2290353wrw.255.1579256264741; Fri, 17 Jan 2020 02:17:44 -0800 (PST) Received: from localhost (prg-ext-pat.suse.com. [213.151.95.130]) by smtp.gmail.com with ESMTPSA id s3sm8680818wmh.25.2020.01.17.02.17.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Jan 2020 02:17:44 -0800 (PST) Date: Fri, 17 Jan 2020 11:17:43 +0100 From: Michal Hocko To: David Hildenbrand Cc: Qian Cai , akpm@linux-foundation.org, sergey.senozhatsky.work@gmail.com, pmladek@suse.com, rostedt@goodmis.org, peterz@infradead.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH -next v4] mm/hotplug: silence a lockdep splat with printk() Message-ID: <20200117101743.GS19428@dhcp22.suse.cz> References: <20200117022111.18807-1-cai@lca.pw> <20200117085932.GK19428@dhcp22.suse.cz> <20200117094009.GP19428@dhcp22.suse.cz> <521da382-d9b2-8556-d603-5537b030d8fd@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <521da382-d9b2-8556-d603-5537b030d8fd@redhat.com> User-Agent: Mutt/1.12.2 (2019-09-21) X-Bogosity: Ham, tests=bogofilter, spamicity=0.000029, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Fri 17-01-20 10:42:10, David Hildenbrand wrote: > On 17.01.20 10:40, Michal Hocko wrote: > > On Fri 17-01-20 10:25:06, David Hildenbrand wrote: > >> On 17.01.20 09:59, Michal Hocko wrote: > >>> On Fri 17-01-20 09:51:05, David Hildenbrand wrote: > >>>> On 17.01.20 03:21, Qian Cai wrote: > >>> [...] > >>>>> Even though has_unmovable_pages doesn't hold any reference to the > >>>>> returned page this should be reasonably safe for the purpose of > >>>>> reporting the page (dump_page) because it cannot be hotremoved. The > >>>> > >>>> This is only true in the context of memory unplug, but not in the > >>>> context of is_mem_section_removable()-> is_pageblock_removable_nolock(). > >>> > >>> Well, the above should hold for that path as well AFAICS. If the page is > >>> unmovable then a racing hotplug cannot remove it, right? Or do you > >>> consider a temporary unmovability to be a problem? > >> > >> Somebody could test /sys/devices/system/memory/memoryX/removable. While > >> returning the unmovable page, it could become movable and > >> offlining+removing could succeed. > > > > Doesn't this path use device lock or something? If not than the new code > > is not more racy then the existing one. Just look at > > is_pageblock_removable_nolock and how it dereferences struct page > > (page_zonenum in page_zone.) > > > > AFAIK no device lock, no device hotplug lock, no memory hotplug lock. I > think it holds a reference to the device and to the kernelfs node. But > AFAIK that does not block removal of offlining/memory, just when the > objects get freed. OK, so we are bug compatible after this patch ;) -- Michal Hocko SUSE Labs