Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp8857428ybl; Fri, 17 Jan 2020 02:18:58 -0800 (PST) X-Google-Smtp-Source: APXvYqxWrLUgQD4WxrHf1LN7pU36Vl3pBRAzBEs599xSdTOaGk9vGQp8tRh3WzZbljhQfhIBytSq X-Received: by 2002:a9d:68cc:: with SMTP id i12mr5515906oto.207.1579256338026; Fri, 17 Jan 2020 02:18:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1579256338; cv=none; d=google.com; s=arc-20160816; b=lHBwKdp44gMGztlbnA2pUFtunRAFLm2nZ6YMzylazjMRQnoz4wby7FPiClVZpIsUvJ Mx33wm6jUi8/CixTq759Wo3jGZdIbAtBtbKHLbZI0sXO7Mp/FtvCwneMk+Zb6maUvaFw G5ZMeK8mDEZwVHexPWQ0FammOb3vRWbnsKYnf0429nnpS4ocO8vRcyFA5JAN3Wft2Xp7 EJTFP21I3GpALOg4nGaeTBphd5RocIEaD1GJcBIaqh9TCL5n2uSOuZPzEwlr0iqyeqQz QRNSeZAZ5Jk8CTrOEP0/F364/yKluSiWcCUMU7TgitH+rcRJK/dtnOD8gz2pveK9N5nU HQWQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=xrJxvLC7Z/aq3pNh/DrH8onU5ingWRht14zTkzqKmZo=; b=LenGDEIfOOBi1i3bZfi9Hcyj67T4d5xcm8emW+ZFfsQtYuHKKNnLl2P/IudADPEnMX HBZ2zJSPFm/L2VYIXOc7Vt42x0A5jhRau1Vz5Hpq0ZBRG8leHZupZvREokwGWf+bbigU /3PxOdc1/6pDFmyTPo6bNv7iBn3bIAGTfv1J8cbtjRuVhfVu62nzHfBKzIKw4szpI5NS t9jrMMkAVqX+8/hLvsuUKXQ7VQN0EgStxDp8MH5B6dQbdEArVEzEVoQ+G9QxwQVcKBVq Q8dWS4Ry4EtpUriBJ7cGIZyjIowDwFhoq915z2p6iLFHHHDXzIAM7v9JVWC2mT9w2xwp WALw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l6si5318905otk.134.2020.01.17.02.18.45; Fri, 17 Jan 2020 02:18:58 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726688AbgAQKRr (ORCPT + 99 others); Fri, 17 Jan 2020 05:17:47 -0500 Received: from mail-wr1-f66.google.com ([209.85.221.66]:40433 "EHLO mail-wr1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726085AbgAQKRr (ORCPT ); Fri, 17 Jan 2020 05:17:47 -0500 Received: by mail-wr1-f66.google.com with SMTP id c14so22108357wrn.7 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=jqUPfG9dVgXrH5MQLdZS0y2gfQS09X1d9FifVRc4K1ZHjfctqJkqEdbxCnN79kvCz1 ZNkLLAzVTER5TjWlZbrWm4/UsMiDOILso2K2BGvDmoapi372YOsLGy0E6zkPpSJcarG4 KZzOgl2YjNumwdjvMBXksRrFyw8pbsK7Wsvh0tkGKMon5svjVrbxKtJkO+VozGAb+FLk +M9Z041o8WobMsq2yXJsF2Q1RELVFCqCzuZECzWL5a0s7DuUIbFoQkr78hfyvGVu2wvE t9GhHHyeBr6MQML9GdmD382cuyoNaTWV+eaGFWU5zbdDv+NUN17U5UmeuUihw/P8y02u /BdA== X-Gm-Message-State: APjAAAWbNpDJeVhdYDDIEN1ObAlVjqzVEVARZ++T+K3jDXsCD7nzUrjV +j0hkH1Fi44Qlx5mydk/Jro= 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) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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