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 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B10E2C433EF for ; Fri, 5 Nov 2021 11:50:11 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 30E5661215 for ; Fri, 5 Nov 2021 11:50:11 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 30E5661215 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linux.dev Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id 9A01F6B006C; Fri, 5 Nov 2021 07:50:10 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 94F5C940007; Fri, 5 Nov 2021 07:50:10 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 83D416B0073; Fri, 5 Nov 2021 07:50:10 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id 751AC6B006C for ; Fri, 5 Nov 2021 07:50:10 -0400 (EDT) Received: from smtpin03.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 2B33F18494E74 for ; Fri, 5 Nov 2021 11:50:10 +0000 (UTC) X-FDA: 78774708180.03.F9B0286 Received: from out1.migadu.com (out1.migadu.com [91.121.223.63]) by imf12.hostedemail.com (Postfix) with ESMTP id 9617610000B4 for ; Fri, 5 Nov 2021 11:50:09 +0000 (UTC) Date: Fri, 5 Nov 2021 20:49:54 +0900 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1636113004; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to; bh=PstElwx1eHISZknSHtmk0mKL3v3w5arvXKrkYvDW1AA=; b=oa9juKgR5gf24x1lNqNPzbpYlKMamJvPc5ehAtL+FdcVMCrIdMPG4JAyNMT+EbAL6o6A86 factHVWknALHVa2daYZdj3NK3ikQ7VbvnufWo34/YgOOtFAj08nTH1ivGJ9JCWlfxUf+50 RKoUN68yCgm3EnDGrAavu2UcdHVUqKI= X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Naoya Horiguchi To: David Hildenbrand Cc: Naoya Horiguchi , linux-mm@kvack.org, Andrew Morton , Oscar Salvador , Michal Hocko , Ding Hui , Tony Luck , "Aneesh Kumar K.V" , Miaohe Lin , Yang Shi , Peter Xu , linux-kernel@vger.kernel.org Subject: Re: [PATCH v3 0/3] mm/hwpoison: fix unpoison_memory() Message-ID: <20211105114954.GA3163106@u2004> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: X-Migadu-Flow: FLOW_OUT X-Migadu-Auth-User: naoya.horiguchi@linux.dev X-Rspamd-Server: rspam03 X-Rspamd-Queue-Id: 9617610000B4 X-Stat-Signature: unyoi9oah5jsp5or98y1mpm1gei6d859 Authentication-Results: imf12.hostedemail.com; dkim=pass header.d=linux.dev header.s=key1 header.b=oa9juKgR; spf=pass (imf12.hostedemail.com: domain of naoya.horiguchi@linux.dev designates 91.121.223.63 as permitted sender) smtp.mailfrom=naoya.horiguchi@linux.dev; dmarc=pass (policy=none) header.from=linux.dev X-HE-Tag: 1636113009-790841 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 Fri, Nov 05, 2021 at 11:58:15AM +0100, David Hildenbrand wrote: > On 05.11.21 06:50, Naoya Horiguchi wrote: > > Hi, > > > > I updated the unpoison patchset based ou discussions over v2. > > Please see individual patches for details of updates. > > > > ----- (cover letter copied from v2) ----- > > Main purpose of this series is to sync unpoison code to recent changes > > around how hwpoison code takes page refcount. Unpoison should work or > > simply fail (without crash) if impossible. > > > > The recent works of keeping hwpoison pages in shmem pagecache introduce > > a new state of hwpoisoned pages, but unpoison for such pages is not > > supported yet with this series. > > > > It seems that soft-offline and unpoison can be used as general purpose > > page offline/online mechanism (not in the context of memory error). > > I'm not sure what the target use case would be TBH ... for proper memory > offlining/memory hotunplug we have to offline whole memory blocks. For > memory ballooning based mechanisms we simply allocate random free pages > and eventually trigger reclaim to make more random free pages available. > For memory hotunplug via virtio-mem we're using alloc_contig_range() to > allocate ranges of interest we logically unplug. I heard about it from two people independently and I think that that's maybe a rough idea, so if no one shows the clear use case or someone logically shows that we don't need it, I do not head for it. > > The only benefit compared to alloc_contig_range() might be that we can > offline smaller chunks -- alloc_contig_range() isn't optimized for > sub-MAX_ORDER granularity yet. But then, alloc_contig_range() should > much rather be extended. If alloc_contig_range() supports memory offline in arbitrary size of granurality (including a single page), maybe soft offline can be (partially I guess) unified to it. Thanks, Naoya Horiguchi > > Long story short, I'm not sure there is a sane use case for this > "general purpose page offline/online mechanism" ...