Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp2987547imu; Mon, 19 Nov 2018 09:02:07 -0800 (PST) X-Google-Smtp-Source: AJdET5d/8szAWvNZIAryEWlSfUCEBkhRu6P7z+oBfH7LcEb9vE20r9xQh3IZ4rfKE717W7c9pErw X-Received: by 2002:a62:5444:: with SMTP id i65mr7661166pfb.193.1542646927475; Mon, 19 Nov 2018 09:02:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542646927; cv=none; d=google.com; s=arc-20160816; b=QlyA2UXMQTvu7pUHXD1ZsU8L8pMnymQS3D9zewgPiIuYRkS6Ll+2F4R0yEHhuNIxPf b6rkR8e7o2XUf7bk7+p8mYY7YSDua9AkocYXnE2oKMdAyeAn62X5TzV/FM6st3XJ1i8y x1C1qx4Xj/HzG5RIqnj0AxlhREdHcMs4wQ3DoPPH/MrpcOljAAmxrfoCaK5d5ldVO5qv Kh0V+fzCcUdoIx6vr3CM1f2rYTbP974u3W3VWFLi1vNzDb/rzCVAN+wMNClrT480PB6B zvzg8BieV0wePRo5diMk97NHVHb4wDOml+OF6t0TjgBfevGWtyuIwsQ18Ql9DOE5CiLr VuYQ== 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=PaW5W0fIVFZYEW03XEstfKPz4hBJSMeJATkFEMD7CU0=; b=y/nBoiXGxwzWWiJgA+sUOTfMrNderbfohmM/ybnXIkcr5Yit4FBhcw0zM7eME8GAQJ FxXFCAmMQDeZtSiBSqYYTpdN/1JmwQ4cOq3tuXmE1UK/3Ar8yEvVc5ZmdKqc6DjMQEeM 3kHEhT0byYBEbxL0/235EpYP6AJ7wkg6LKpc/+l07WDqtSeXp+m/VI2UUKKsGy2osnG9 iaCPARAIixaGPfA93Cdap/5kJuovpYk08hCCfnoLZwPaPpRL2dcUp6qa2FAaGnUnSuYF lGbTqJfwLkxrfees20x2088kzv+8hXli4+J0V+XBacwNNue0I7quo021WnQt3lZ30h3e fbsg== 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 h4-v6si3384053plt.315.2018.11.19.09.01.49; Mon, 19 Nov 2018 09:02:07 -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 S2405569AbeKTDZY (ORCPT + 99 others); Mon, 19 Nov 2018 22:25:24 -0500 Received: from mx2.suse.de ([195.135.220.15]:40912 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S2404694AbeKTDZX (ORCPT ); Mon, 19 Nov 2018 22:25:23 -0500 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 ECCD4AE99; Mon, 19 Nov 2018 17:01:06 +0000 (UTC) Date: Mon, 19 Nov 2018 18:01:05 +0100 From: Michal Hocko To: Vlastimil Babka Cc: Baoquan He , David Hildenbrand , linux-mm@kvack.org, pifang@redhat.com, linux-kernel@vger.kernel.org, akpm@linux-foundation.org, aarcange@redhat.com, Mel Gorman , Hugh Dickins Subject: Re: Memory hotplug softlock issue Message-ID: <20181119170105.GT22247@dhcp22.suse.cz> References: <20181116012433.GU2653@MiWiFi-R3L-srv> <20181116091409.GD14706@dhcp22.suse.cz> <20181119105202.GE18471@MiWiFi-R3L-srv> <20181119124033.GJ22247@dhcp22.suse.cz> <20181119125121.GK22247@dhcp22.suse.cz> <20181119141016.GO22247@dhcp22.suse.cz> <20181119164618.GQ22247@dhcp22.suse.cz> <6017b36f-3e29-c2ad-f2d1-2ebd77bbaef1@suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <6017b36f-3e29-c2ad-f2d1-2ebd77bbaef1@suse.cz> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon 19-11-18 17:48:35, Vlastimil Babka wrote: > On 11/19/18 5:46 PM, Vlastimil Babka wrote: > > On 11/19/18 5:46 PM, Michal Hocko wrote: > >> On Mon 19-11-18 17:36:21, Vlastimil Babka wrote: > >>> > >>> So what protects us from locking a page whose refcount dropped to zero? > >>> and is being freed? The checks in freeing path won't be happy about a > >>> stray lock. > >> > >> Nothing really prevents that. But does it matter. The worst that might > >> happen is that we lock a freed or reused page. Who would complain? > > > > free_pages_check() for example > > > > PAGE_FLAGS_CHECK_AT_FREE includes PG_locked Right you are. > And besides... what about the last page being offlined and then the > whole struct page's part of vmemmap destroyed as the node goes away? Yeah, that is quite unlikely though because the there is quite a large time window between the two events. I am not entirely sure we are safe right now TBH. Any access to the struct page after the put_page is unsafe theoretically. Then we have to come up with something more clever I am afraid. -- Michal Hocko SUSE Labs