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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id D3872C19F2D for ; Tue, 9 Aug 2022 17:11:46 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 3104A8E0002; Tue, 9 Aug 2022 13:11:46 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 2BE718E0001; Tue, 9 Aug 2022 13:11:46 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 15F708E0002; Tue, 9 Aug 2022 13:11:46 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id 033878E0001 for ; Tue, 9 Aug 2022 13:11:46 -0400 (EDT) Received: from smtpin12.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id C8CBA14111B for ; Tue, 9 Aug 2022 17:11:45 +0000 (UTC) X-FDA: 79780696170.12.190E59C Received: from mail-pl1-f179.google.com (mail-pl1-f179.google.com [209.85.214.179]) by imf26.hostedemail.com (Postfix) with ESMTP id 45952140170 for ; Tue, 9 Aug 2022 17:11:45 +0000 (UTC) Received: by mail-pl1-f179.google.com with SMTP id g13so4979580plo.6 for ; Tue, 09 Aug 2022 10:11:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc; bh=LELeyjU2wcn4KWUM76Z5WghrJtriMPw8sOKX4EVWXeY=; b=Fh8bYYKpmmyzk0a71fpY04drz4M4AH1XN3cylscD4S+6uptKG2LRP8Dakm1jD9DETs MWwbirzue7gZOpW+fn8GO1qDTJhe4tx6AB5VsiXjXvGusNSlAAbqvOj3JZg/f/BYox/e 0f1b81cePz5c0315ChPsbUnQZ7MQKskz5goF6x/xQOsMoAW8TIlqwTeGFBfyQEDlUP+6 dQpzvfpjoudMFK3lxFgykZ5kJLjP/BKjfepCwqjCeoZVMn3L5wBVojQ4TZHAxU8co1WN Bb2XDu47UmUX0pijqXXjV8CMEt/QwQ2od9lg7rgHA5jWBqoZM8uLxzLMMWqGyylFllLC b/Xw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc; bh=LELeyjU2wcn4KWUM76Z5WghrJtriMPw8sOKX4EVWXeY=; b=RwP/XL+Cdc/PDJ9EElXLLh7dpBrOGxmRxYvMuU3ouWzI9rvYpHCaCZ2seybC03pMJu utS8SL9N4I+WYoEMqwFd99rAsySeaXNKycro0evPnPfRKoTwObEDuQkantyOaRX7rgrZ 1L//4jwDle9yiCAIv1b9ncKmPU1Rtp97g9ft2GsUF+w+S6YqjKtWah0TUGiaWa25uP9N AfpqWyGaekP8PGhzD/53O6kvMM8tIghHgVGpu2Kk03Dox8ogY7XMQiHIbc+v4HkeTpgg MKeEDMTYn+taJnmGD/VTLBQ1HIkoib6yafPhW97jbrt4p+2DU396yO4qz/w8y29Nf6hn z0+Q== X-Gm-Message-State: ACgBeo3ku2edIBDL2wDauKjjNmvZWrTP9jLiB9WOPC9v/AwnAdpmIHw6 fgPYd7ziYACOuGL8X+ugoBaicmmLYMbnbJHrK2c= X-Google-Smtp-Source: AA6agR6V2aX2w1kWVO63b7s0FIwJoICLEpxmvG2FuyWXdznHPgHZ/2G+gpUVdP8m/prf/unM0ZrVPxk72j5hdcB4J2A= X-Received: by 2002:a17:903:32c9:b0:171:2846:eef8 with SMTP id i9-20020a17090332c900b001712846eef8mr2880769plr.117.1660065104221; Tue, 09 Aug 2022 10:11:44 -0700 (PDT) MIME-Version: 1.0 References: <20220805184016.2926168-1-alexlzhu@fb.com> <0b16dbac6444bfcdfbeb4df4280354839bfe1a8f.camel@fb.com> In-Reply-To: From: Yang Shi Date: Tue, 9 Aug 2022 10:11:31 -0700 Message-ID: Subject: Re: [PATCH v3] mm: add thp_utilization metrics to /proc/thp_utilization To: Rik van Riel Cc: "Alex Zhu (Kernel)" , Kernel Team , "linux-mm@kvack.org" , "willy@infradead.org" , "linux-kernel@vger.kernel.org" , "akpm@linux-foundation.org" Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1660065105; a=rsa-sha256; cv=none; b=jk2Gxl/295soiQHRt2OswayUhlwDvQ638oD28ECRM4Detb0oNBJtDu+fPbSsqJNTn7rA4j SqmhnHmaalmWW0/hxpqxevYLd7Ma4ktQvMLbQpOdZT/iFEUD5qP+FgaGoXPu591SFn+52D 9gnazurQ3fHCt90AAi5PqrK9TiaCv14= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1660065105; h=from:from:sender: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:dkim-signature; bh=LELeyjU2wcn4KWUM76Z5WghrJtriMPw8sOKX4EVWXeY=; b=zvtrqfI1nag72L1IKMG0kt2jWNRTaWvrvjzBK86RKYuq2i0dQaMcHWfE4aPbBjTG8ZJ/Mb qXbs4uFgi+xcP9PNRfUfE/6lY/p9GT+6NQbaWzQEPput3wT3ZTD/RClKjqk9zxeI4iw9T5 F2UVODkj8V9dWzwXBQ1Pta98OEM6aDg= ARC-Authentication-Results: i=1; imf26.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=Fh8bYYKp; spf=pass (imf26.hostedemail.com: domain of shy828301@gmail.com designates 209.85.214.179 as permitted sender) smtp.mailfrom=shy828301@gmail.com; dmarc=pass (policy=none) header.from=gmail.com X-Stat-Signature: i1n55r4o9b66m7w6mxipku3a1ush31y8 X-Rspam-User: X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: 45952140170 Authentication-Results: imf26.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=Fh8bYYKp; spf=pass (imf26.hostedemail.com: domain of shy828301@gmail.com designates 209.85.214.179 as permitted sender) smtp.mailfrom=shy828301@gmail.com; dmarc=pass (policy=none) header.from=gmail.com X-HE-Tag: 1660065105-704960 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 Mon, Aug 8, 2022 at 11:35 AM Rik van Riel wrote: > > On Mon, 2022-08-08 at 10:55 -0700, Yang Shi wrote: > > > > On Fri, Aug 5, 2022 at 12:52 PM Alex Zhu (Kernel) > > wrote: > > > > > > Sounds good, I=E2=80=99ll move this to debugfs then. Will follow up w= ith > > > the shrinker code > > > in another patch. The shrinker relies on this scanning thread to > > > figure out which > > > THPs to reclaim. > > > > I'm wondering whether you could reuse the THP deferred split shrinker > > or not. It is already memcg aware. > > > I'm not convinced that will buy much, since there is > very little code duplication between the two. > > Merging the two might also bring about another bit of > extra complexity, due to the deferred split shrinker > wanting to shrink every single THP on its "to split" > list, while for Alex's shrinker we probably want to > split just one (or a few) THPs at a time, depending on > memory pressure. OK, it is hard to tell what it looks like now. But the THPs on the deferred split list may be on the "low utilization split" list too? IIUC the major difference is to replace zero-filled subpage to special zero page, so you implemented another THP split function to handle it? Anyway the code should answer the most questions. >