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=-10.3 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=ham 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 D1E62C48BE5 for ; Thu, 17 Jun 2021 11:15:43 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 76259613CE for ; Thu, 17 Jun 2021 11:15:43 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 76259613CE Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=techsingularity.net Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 093296B0070; Thu, 17 Jun 2021 07:15:43 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 06A546B0071; Thu, 17 Jun 2021 07:15:43 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id E73DC6B0072; Thu, 17 Jun 2021 07:15:42 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0244.hostedemail.com [216.40.44.244]) by kanga.kvack.org (Postfix) with ESMTP id B4FB76B0070 for ; Thu, 17 Jun 2021 07:15:42 -0400 (EDT) Received: from smtpin29.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 38AB9181AEF00 for ; Thu, 17 Jun 2021 11:15:42 +0000 (UTC) X-FDA: 78262960524.29.6CF4EE6 Received: from outbound-smtp07.blacknight.com (outbound-smtp07.blacknight.com [46.22.139.12]) by imf07.hostedemail.com (Postfix) with ESMTP id 58FF1A000264 for ; Thu, 17 Jun 2021 11:15:30 +0000 (UTC) Received: from mail.blacknight.com (pemlinmail02.blacknight.ie [81.17.254.11]) by outbound-smtp07.blacknight.com (Postfix) with ESMTPS id C35371C42FC 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) X-Rspamd-Server: rspam01 X-Rspamd-Queue-Id: 58FF1A000264 Authentication-Results: imf07.hostedemail.com; dkim=none; dmarc=none; spf=pass (imf07.hostedemail.com: domain of mgorman@techsingularity.net designates 46.22.139.12 as permitted sender) smtp.mailfrom=mgorman@techsingularity.net X-Stat-Signature: gihmp69rri1qaqmobs4brp9w7bh4ribw X-HE-Tag: 1623928530-386420 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: 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