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 BFE8AC33CB1 for ; Fri, 17 Jan 2020 09:40:13 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 86AF620730 for ; Fri, 17 Jan 2020 09:40:13 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 86AF620730 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 1073F6B0341; Fri, 17 Jan 2020 04:40:13 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 0B8BA6B0342; Fri, 17 Jan 2020 04:40:13 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id F10A26B0344; Fri, 17 Jan 2020 04:40:12 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0068.hostedemail.com [216.40.44.68]) by kanga.kvack.org (Postfix) with ESMTP id D805D6B0341 for ; Fri, 17 Jan 2020 04:40:12 -0500 (EST) Received: from smtpin19.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with SMTP id 974CC824556B for ; Fri, 17 Jan 2020 09:40:12 +0000 (UTC) X-FDA: 76386630264.19.bell73_1cac0344143a X-HE-Tag: bell73_1cac0344143a X-Filterd-Recvd-Size: 3763 Received: from mail-wr1-f67.google.com (mail-wr1-f67.google.com [209.85.221.67]) by imf01.hostedemail.com (Postfix) with ESMTP for ; Fri, 17 Jan 2020 09:40:12 +0000 (UTC) Received: by mail-wr1-f67.google.com with SMTP id c9so21991723wrw.8 for ; Fri, 17 Jan 2020 01:40:12 -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=tvr1JplSwE1Nh+0Rfwn/I+92DolIasGyNqPK2F8NHJM=; b=JCzjDMfoz+JEt4Su0SzGdKRo1TOEsky/QBeqF3JZxb9Onvx3mNM9sQHqxtcm+oL5VG Qr9gZ9Ke+kOwOLwGBNmxHtzw9Xl/R7gt5XGr4aliZUZ+INAiiWxYAs3U1Skl+LCaLIYg 8SS1ppGHMEUl6sX+as7Zb0EcuN0OAqIV0dJqV+oaX9t58C9obpBE20DtiU+3bzZ0lxx+ LTPfXkZzi8Bf2Euw7e3RtQ43I1/tNVQwT27yCLqLOsKEUKaKxF16580e3sGoENnHHJfz RoAMxNGNh9rWp4E1jcw4qx1+ieJfAF0D7nnjws/RmvLV1WwOfGrvprKk7F5lhgHkGLrh uEBw== X-Gm-Message-State: APjAAAWNUyyS882wwlP4CY3/BubiJPlYa0fJnFWVyA82wpaVjSp78eS+ T7evYcnyb5GM8fs4UNAr720= X-Google-Smtp-Source: APXvYqzkrIXzunc/uYXDhzL8/S19ckAbHFJkQVLLeYE2bCafJrJH6Liu3rFvQpCzPaVVKwxD7KM6Hg== X-Received: by 2002:a5d:540f:: with SMTP id g15mr2026501wrv.86.1579254011010; Fri, 17 Jan 2020 01:40:11 -0800 (PST) Received: from localhost (prg-ext-pat.suse.com. [213.151.95.130]) by smtp.gmail.com with ESMTPSA id x16sm2876904wmk.35.2020.01.17.01.40.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Jan 2020 01:40:10 -0800 (PST) Date: Fri, 17 Jan 2020 10:40:09 +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: <20200117094009.GP19428@dhcp22.suse.cz> References: <20200117022111.18807-1-cai@lca.pw> <20200117085932.GK19428@dhcp22.suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.12.2 (2019-09-21) X-Bogosity: Ham, tests=bogofilter, spamicity=0.017925, 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: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.) -- Michal Hocko SUSE Labs