Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp1431709imu; Tue, 20 Nov 2018 18:06:58 -0800 (PST) X-Google-Smtp-Source: AFSGD/VsTorV9DsCITQMzlxSfTVdZQdEKZk6309kds0kVAKwSdvfdNJ2IJbLOas2qv0gfskUR6gT X-Received: by 2002:a17:902:227:: with SMTP id 36mr4818758plc.140.1542766018063; Tue, 20 Nov 2018 18:06:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542766018; cv=none; d=google.com; s=arc-20160816; b=jNT25heUoZyV7HfayNzSF/S3nAsDxptqVUTTLiBdhx7apPHv2oaaFnZdJTYeZjfzVn kVcScKGxweLvSPcki6MfMFGh51ygWWy0SAlHHR5eVEEprMeripRq60cy44PeJI5mEqTm JrNHASBs7tL9rtIg207/ElKGvWE7gs8nD6cnrZ5sQAkNiUVOxoKq2KMNr0hsSGhkMgtK XOR4DF8Sg0ECqei59PCE7mwbZJLiDT3mtbcH/xFl+D1Uccg+F6spYOV7Hf/83Gfx+SoH wGKFr7yqJVsdRXdKJeFcQ8FbvmwiycdoIQx95RqyqHBrcoSbhnNSYHnYE5mQ9HBK5TqL KaCA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :message-id:in-reply-to:subject:cc:to:from:date:dkim-signature; bh=2D73gjRidyYQ/3FyXjZa4h5O4Q+am1oL7JNrgFkWp0o=; b=ZbHFrdYswXcyoNa7DM33xKQNdf8D+LzmGs/QakYv28t9liyleq4QqoZaKE8MdkaCnR 7b71zkMLsDMyuUVoHFI5ZgLSUlrwplF73ypj+7+ag+6+bweTfqLoKqEbiYkgbNnpWrLP 1t15tt8PW+KVm1MO9jHEQ1dLoQjY7rUNGci0YaSW0gjd2DXKMNfrBOjWFsShXNQ3v2PU t0ibI8eqthDEMmL6i9Jx2KLDlMto2Pm7F9aqKXLQc6OXFE8/vlMCkn3s46vmA19HUluF MT+B7O7NXH72Ncj9zqkrVn51sK++fE26di+pjTP59jW47bNI0JaysbvGF+NNiZOdRYMw gl0Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=cl5jJ6D9; 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=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n78si27943344pfi.235.2018.11.20.18.06.41; Tue, 20 Nov 2018 18:06: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; dkim=pass header.i=@google.com header.s=20161025 header.b=cl5jJ6D9; 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=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726434AbeKULxp (ORCPT + 99 others); Wed, 21 Nov 2018 06:53:45 -0500 Received: from mail-pl1-f193.google.com ([209.85.214.193]:44337 "EHLO mail-pl1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725949AbeKULxo (ORCPT ); Wed, 21 Nov 2018 06:53:44 -0500 Received: by mail-pl1-f193.google.com with SMTP id s5-v6so2912204plq.11 for ; Tue, 20 Nov 2018 17:21:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:from:to:cc:subject:in-reply-to:message-id:references :user-agent:mime-version; bh=2D73gjRidyYQ/3FyXjZa4h5O4Q+am1oL7JNrgFkWp0o=; b=cl5jJ6D9G9fBFlUUph2l0Zwa0pqxtvCMMenC9DAXuUiurcNxPcGamhS4wQzQhx4F3d 5rN82FohTLTliLyFFafj5EdgWEDAQ+3yrSfl3gm8uj6xRTFwmnb4RYS/IIPWTu5h9+oS uY80JX9xxTv6QVrbK2SONNnzYHyGZy+V7DOJisb6oZmFghKNz4dX7WV05W8DdeyEvuZU rx6AXbl4R1LZ0+dAUxemK+F9fALUQsrPBik1W6bAfI20Vn739kKOkziN4N9+sMEfiDFz Oi4FX7ClAvmRNYosQQqXkJn00244WnfRrYQXNYuN7g+nsDFMvZanSOER/u1NC3MUvtF2 xuIQ== 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:in-reply-to:message-id :references:user-agent:mime-version; bh=2D73gjRidyYQ/3FyXjZa4h5O4Q+am1oL7JNrgFkWp0o=; b=qQ/lT9MFni0JBb6YUs4YKYXaEa4UnyZxYi41xEiTaqpE5zGgz0x2zUH/zsicNP8Yoy ocyTUFe2z4O7D70wpUIdhSB8mWs1nEBJl/I0BYEcnoHOa0x7w0OoLiqMEfL0mw45m/ZN i7QbIUdrPamd9UnVisyqMPxK/Gd0G+1vH/ZHFINQqhroSsupLwxLQBtfgd9S6B1UAEiq 4l7UioSxby1bH0T7NcO1FkAWq8FitKIyUH/Fi5ZbQ5R+C0ljqQTQtrpp+y8M346moN/6 NJHU9Uz1tvTeMwtCaL06izF0ACurqMYUCTNuuD+IOsnc9iBbipIg//7x9oCPzuO9xBCt TrQQ== X-Gm-Message-State: AGRZ1gK46HZO94H0K0xBGSwtLGtbQUXrWIbcESsYaveQuAg/D/rt8XYk eARqH0tV54s0Ik7br53zk8KIKQ== X-Received: by 2002:a62:8c11:: with SMTP id m17mr4651342pfd.224.1542763298445; Tue, 20 Nov 2018 17:21:38 -0800 (PST) Received: from [100.112.89.103] ([104.133.8.103]) by smtp.gmail.com with ESMTPSA id p6sm23987613pfn.53.2018.11.20.17.21.37 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 20 Nov 2018 17:21:37 -0800 (PST) Date: Tue, 20 Nov 2018 17:21:36 -0800 (PST) From: Hugh Dickins X-X-Sender: hugh@eggly.anvils To: Baoquan He cc: Hugh Dickins , Michal Hocko , Vlastimil Babka , pifang@redhat.com, David Hildenbrand , linux-mm@kvack.org, linux-kernel@vger.kernel.org, akpm@linux-foundation.org, aarcange@redhat.com, Mel Gorman Subject: Re: Memory hotplug softlock issue In-Reply-To: <20181120135803.GA3369@MiWiFi-R3L-srv> Message-ID: References: <20181119105202.GE18471@MiWiFi-R3L-srv> <20181119124033.GJ22247@dhcp22.suse.cz> <20181119125121.GK22247@dhcp22.suse.cz> <20181119141016.GO22247@dhcp22.suse.cz> <20181119173312.GV22247@dhcp22.suse.cz> <20181119205907.GW22247@dhcp22.suse.cz> <20181120015644.GA5727@MiWiFi-R3L-srv> <3f1a82a8-f2aa-ac5e-e6a8-057256162321@suse.cz> <20181120135803.GA3369@MiWiFi-R3L-srv> User-Agent: Alpine 2.11 (LSU 23 2013-08-11) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 20 Nov 2018, Baoquan He wrote: > On 11/20/18 at 02:38pm, Vlastimil Babka wrote: > > On 11/20/18 6:44 AM, Hugh Dickins wrote: > > > [PATCH] mm: put_and_wait_on_page_locked() while page is migrated > > > > > > We have all assumed that it is essential to hold a page reference while > > > waiting on a page lock: partly to guarantee that there is still a struct > > > page when MEMORY_HOTREMOVE is configured, but also to protect against > > > reuse of the struct page going to someone who then holds the page locked > > > indefinitely, when the waiter can reasonably expect timely unlocking. > > > > > > But in fact, so long as wait_on_page_bit_common() does the put_page(), > > > and is careful not to rely on struct page contents thereafter, there is > > > no need to hold a reference to the page while waiting on it. That does > > > > So there's still a moment where refcount is elevated, but hopefully > > short enough, right? Let's see if it survives Baoquan's stress testing. > > Yes, I applied Hugh's patch 8 hours ago, then our QE Ping operated on > that machine, after many times of hot removing/adding, the endless > looping during mirgrating is not seen any more. The test result for > Hugh's patch is positive. I even suggested Ping increasing the memory > pressure to "stress -m 250", it still succeeded to offline and remove. > > So I think this patch works to solve the issue. Thanks a lot for your > help, all of you. Very good to hear, thanks a lot for your quick feedback. > > High, will you post a formal patch in a separate thread? Yes, I promise that I shall do so in the next few days, but not today: some other things have to take priority. And Vlastimil has raised an excellent point about the interaction with PSI "thrashing": I need to read up and decide which way to go on that (and add Johannes to the Cc when I post). I think I shall probably post it directly to Linus (lists and other people Cc'ed of course): not because I think it should be rushed in too quickly, nor to sidestep Andrew, but because Linus was very closely involved in both the PG_waiters and WQ_FLAG_BOOKMARK discussions: it is an area of special interest to him. Hugh