Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp361216pxj; Thu, 17 Jun 2021 04:35:34 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzILSZ2T63MnZ1Rq3OLAgtqwgcuO8jDGY726WTdyRhA6K/t9EIYPLehBIZpb4Dg81TME5cO X-Received: by 2002:a05:6602:1546:: with SMTP id h6mr3492516iow.34.1623929734549; Thu, 17 Jun 2021 04:35:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623929734; cv=none; d=google.com; s=arc-20160816; b=JCETzMUdbXdCw6yZh/e5KZzk/ClKqGT1lsdTZbOvE5qHpmYb9xQYDjxUC5ydySMGfC k+9Uzt88hCGlfpM/EMeIwjSmnWEyag4UbG5hskZXRxunI+xyaasG9RJ8kHS2QVdYgDRq FnpE+KuQC9jI1tkMqMNnG82PVYobo2ZlDfaQRXbuuQ/7EybHnwa4+ksxvah2ciesUNJP CoFCGblcZljm2aM5P6Y+igWK9yP1+S0GKsxXqqvGSDAiPDkcObXTjJ9945tvbITYKuN3 oArIASI8s7Jc4NIwgj7henViEMnO78l+V8tWHyP4Yssu2l6nTgLB3uebpxjFeKaue3om O2pw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=R5jGPxPHu3w/GGSk7boj05YzGM5Ry2CKlCzmdxwpQBM=; b=nOd6zijHyMpOKY6ond1oPxwlCpLTzN0rH5xkxE0jLFKUOgsxiOAL9bc22jYIcLk9mV COsSZmMgkmLQB7gcMRL5SJTamWXgzSWttgZXGVcubvfDngGJtYV0z+St/YN34lTu6ypu hA1cSKq1ap+V23HmRzxLVNn/rA7/rIiYPqfyvI/XjQbWtaoVFwrx3moDu9UFrctPk1AL K23H5rm+7k2r32ghuLgqRwOM/+nruiGNc4ilKisdymbWI3hDfNqK3c/5i1r4xnc6I+lT 1kH9zMEPPNTa0V9x6sFoyNSyHjH89ZPR6+qa1LMHfwxKMEiZhG4m5WuPsKjUKDYb0Qc+ 55tA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id h41si5310260jaa.50.2021.06.17.04.35.22; Thu, 17 Jun 2021 04:35:34 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232432AbhFQLRs (ORCPT + 99 others); Thu, 17 Jun 2021 07:17:48 -0400 Received: from outbound-smtp33.blacknight.com ([81.17.249.66]:32886 "EHLO outbound-smtp33.blacknight.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232097AbhFQLRs (ORCPT ); Thu, 17 Jun 2021 07:17:48 -0400 Received: from mail.blacknight.com (pemlinmail02.blacknight.ie [81.17.254.11]) by outbound-smtp33.blacknight.com (Postfix) with ESMTPS id C97C5BAE5D for ; Thu, 17 Jun 2021 12:15:39 +0100 (IST) Received: (qmail 18185 invoked from network); 17 Jun 2021 11:15:39 -0000 Received: from unknown (HELO techsingularity.net) (mgorman@techsingularity.net@[84.203.17.255]) by 81.17.254.9 with ESMTPSA (AES256-SHA encrypted, authenticated); 17 Jun 2021 11:15:39 -0000 Date: Thu, 17 Jun 2021 12:15:38 +0100 From: Mel Gorman To: Naoya Horiguchi Cc: linux-mm@kvack.org, Andrew Morton , Mike Kravetz , David Hildenbrand , Oscar Salvador , Michal Hocko , Naoya Horiguchi , linux-kernel@vger.kernel.org Subject: Re: [PATCH mmotm v1] mm/hwpoison: disable pcp for page_handle_poison() Message-ID: <20210617111538.GO30378@techsingularity.net> References: <20210617092626.291006-1-nao.horiguchi@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Disposition: inline In-Reply-To: <20210617092626.291006-1-nao.horiguchi@gmail.com> User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jun 17, 2021 at 06:26:26PM +0900, Naoya Horiguchi wrote: > From: Naoya Horiguchi > > Recent changes by patch "mm/page_alloc: allow high-order pages to be > stored on the per-cpu lists" makes kernels determine whether to use pcp > by pcp_allowed_order(), which breaks soft-offline for hugetlb pages. > > Soft-offline dissolves a migration source page, then removes it from > buddy free list, so it's assumed that any subpage of the soft-offlined > hugepage are recognized as a buddy page just after returning from > dissolve_free_huge_page(). pcp_allowed_order() returns true for > hugetlb, so this assumption is no longer true. > > So disable pcp during dissolve_free_huge_page() and > take_page_off_buddy() to prevent soft-offlined hugepages from linking to > pcp lists. Soft-offline should not be common events so the impact on > performance should be minimal. And I think that the optimization of > Mel's patch could benefit to hugetlb so zone_pcp_disable() is called > only in hwpoison context. > > Signed-off-by: Naoya Horiguchi I think this is ok, it'll remove a page that is to be poisoned from the PCP lists and put them back in the page allocator. It's a heavy but rare operation and identifying what PCP list a free page is on would be tricky so Acked-by: Mel Gorman The alternative I guess would be specical casing update_and_free_page to bypass the PCP but it'd be clumsy from an API point of view and I don't think it's worth the effort. -- Mel Gorman SUSE Labs