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=-8.8 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,NICE_REPLY_A, 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 8BC80C4338F for ; Mon, 16 Aug 2021 19:15:09 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 2E9E060F55 for ; Mon, 16 Aug 2021 19:15:09 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 2E9E060F55 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id 8992F6B0073; Mon, 16 Aug 2021 15:15:08 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 84A226B0074; Mon, 16 Aug 2021 15:15:08 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 7396B6B0075; Mon, 16 Aug 2021 15:15:08 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0043.hostedemail.com [216.40.44.43]) by kanga.kvack.org (Postfix) with ESMTP id 5B1976B0073 for ; Mon, 16 Aug 2021 15:15:08 -0400 (EDT) Received: from smtpin12.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id E43451815560B for ; Mon, 16 Aug 2021 19:15:07 +0000 (UTC) X-FDA: 78481896654.12.D8E632E Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by imf03.hostedemail.com (Postfix) with ESMTP id 86EB6300277B for ; Mon, 16 Aug 2021 19:15:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1629141306; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=0fYCxlBvMGA/LBXj8tHruKymgQRzsd2D5alI8z9FqnE=; b=W03TUqmErJaoGmxbngFDMYhQxaSrz4GSYayJ5D0QdkvMzNyE6k6T/0ZhflWorBrreF/b+w PClKBq3CDZ+AXkTF9ylCuxLvWqx0aSsuhEl2w4E/cpxYU8nLwel7ah+lNe3leP2eMX4bAd MknZdVP7D+8mtrc4M0PmCL9lj2GQKl4= Received: from mail-wm1-f69.google.com (mail-wm1-f69.google.com [209.85.128.69]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-249-UyJkdSJkMgyIJww-LEY22w-1; Mon, 16 Aug 2021 15:15:05 -0400 X-MC-Unique: UyJkdSJkMgyIJww-LEY22w-1 Received: by mail-wm1-f69.google.com with SMTP id y186-20020a1c32c30000b02902b5ac887cfcso91847wmy.2 for ; Mon, 16 Aug 2021 12:15:05 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:to:cc:references:from:organization:subject :message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=0fYCxlBvMGA/LBXj8tHruKymgQRzsd2D5alI8z9FqnE=; b=HPemhn6DxKvlol2YlLfkswCoWkRzndJOIDoIyCD6j7289PVCIUSObaf8V5/EBfsiU7 gIct2vkkbrXba9CTzHweOV+fwHkMOCXl0gDMiF2JJcMmWdvbTpm8wzgkpLLfATafAS5V QZRSG0Egx8pmwHjci0IflbtFQLj3a203jh31AmFfGZK3r0sua4kmaqWye/J9JjXbXyqt bQRTX70aHEtFGYT5J4wtGcH3xvF3FwGRXGyQZTLLOpSfpovVbMYUHmofs0BI2ZwFdZM/ niIwIlZVhn81FfMpBxWv+SI0QQFOnTKHe/pHQ34/T5/lspb5tc23q154L236+9X2o1r3 jH7Q== X-Gm-Message-State: AOAM530Fww29v7tv1eEwaOrc+bWORNDrrVQL1rOnk0L17B1VAwTFACWN d9ZUsU9msBwKWTNeUMCL1gts8Ger2wkSJiIRZ9cCMHkkh+dDNVhTVYZS0OY5WqoWosWLO8KJCdT Da8IQfDGqpSU= X-Received: by 2002:a5d:4bd1:: with SMTP id l17mr19021wrt.5.1629141304558; Mon, 16 Aug 2021 12:15:04 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxGMAV4ypYcEuNTTFWxKeTz0UQWx3vLgwHnm1667BgV+Huo+EPminRnsv0YDIDvBsvfww0XYw== X-Received: by 2002:a5d:4bd1:: with SMTP id l17mr19006wrt.5.1629141304380; Mon, 16 Aug 2021 12:15:04 -0700 (PDT) Received: from [192.168.3.132] (p5b0c67f1.dip0.t-ipconnect.de. [91.12.103.241]) by smtp.gmail.com with ESMTPSA id w14sm87376wrt.23.2021.08.16.12.15.03 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 16 Aug 2021 12:15:03 -0700 (PDT) To: Yang Shi , naoya.horiguchi@nec.com, osalvador@suse.de, tdmackey@twitter.com, akpm@linux-foundation.org, corbet@lwn.net Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org References: <20210816180909.3603-1-shy828301@gmail.com> From: David Hildenbrand Organization: Red Hat Subject: Re: [PATCH 1/2] mm: hwpoison: don't drop slab caches for offlining non-LRU page Message-ID: <08a5ad43-7922-8cf8-31ed-4f6e0c346516@redhat.com> Date: Mon, 16 Aug 2021 21:15:03 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: <20210816180909.3603-1-shy828301@gmail.com> X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Authentication-Results: imf03.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=W03TUqmE; dmarc=pass (policy=none) header.from=redhat.com; spf=none (imf03.hostedemail.com: domain of david@redhat.com has no SPF policy when checking 216.205.24.124) smtp.mailfrom=david@redhat.com X-Stat-Signature: tg9wpyt7fu6gakpo4rgxxjtmczqszubi X-Rspamd-Queue-Id: 86EB6300277B X-Rspamd-Server: rspam05 X-HE-Tag: 1629141307-173936 Content-Transfer-Encoding: quoted-printable 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 16.08.21 20:09, Yang Shi wrote: > In the current implementation of soft offline, if non-LRU page is met, > all the slab caches will be dropped to free the page then offline. But > if the page is not slab page all the effort is wasted in vain. Even > though it is a slab page, it is not guaranteed the page could be freed > at all. ... but there is a chance it could be and the current behavior is=20 actually helpful in some setups. [...] > The lockup made the machine is quite unusable. And it also made the > most workingset gone, the reclaimabled slab caches were reduced from 12= G > to 300MB, the page caches were decreased from 17G to 4G. >=20 > But the most disappointing thing is all the effort doesn't make the pag= e > offline, it just returns: >=20 > soft_offline: 0x1469f2: unknown non LRU page type 5ffff0000000000 () >=20 In your example, yes. I had a look at the introducing commit:=20 facb6011f399 ("HWPOISON: Add soft page offline support") " When the page is not free or LRU we try to free pages from slab and other caches. The slab freeing is currently quite dumb and does not try to focus on the specific slab cache which might own the page. This could be potentially improved later. " I wonder, if instead of removing it altogether, we could actually=20 improve it as envisioned. To be precise, for alloc_contig_range() it would also make sense to be=20 able to shrink only in a specific physical memory range; this here seems=20 to be a similar thing. (actually, alloc_contig_range(), actual memory=20 offlining and hw poisoning/soft-offlining have a lot in common) Unfortunately, the last time I took a brief look at teaching shrinkers=20 to be range-aware, it turned out to be a lot of work ... so maybe this=20 is really a long term goal to be mitigated in the meantime by disabling=20 it, if it turns out to be more of a problem than actually help. --=20 Thanks, David / dhildenb