Received: by 2002:ab2:b82:0:b0:1f3:401:3cfb with SMTP id 2csp85348lqh; Wed, 27 Mar 2024 15:54:20 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVn5KobAldXW/oISCVKT7uvqylH3jsN679kQvSy5eHdtyrJN+ZcmnmU9t2Ywyrrsin3aKihWauqO3ehii5hfVWV1wJUF8BEm3NnDJiLqg== X-Google-Smtp-Source: AGHT+IEpUJ/vYkhuFgs7OOYMMh7U6q/QmKbG2K1Js//3FnLSmCWFVszn/mSUkW+G0pN+xf2Zy+mt X-Received: by 2002:a05:6a00:811:b0:6ea:749c:7849 with SMTP id m17-20020a056a00081100b006ea749c7849mr1594061pfk.13.1711580060484; Wed, 27 Mar 2024 15:54:20 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711580060; cv=pass; d=google.com; s=arc-20160816; b=QjL6tDd+z+PW5yvzn4pwjNQWwH/XsZLnUUsplRourO9gJuAKBq4+uy3sRaH1xYiwVH cwVUOq/74lUmcDnbIQY0kFJmg5odlj8919nFLqQX6YcWl1T9Tl6JUkjDkT+kJ1aLzed+ 1QCQxOIE5PVUxl/ng/fOxDszlKA9aIRtzKRzUn8aD36rGCfrqLLiukyCLctC4Xv2w8l5 NrElmZrqO/1yhTSv4yzZ89uZBYosxL71f8FAscmHuocaO7TxOO5/6iWOlGrTbZBRZL5Z zwqtNIy12BDsK/wwyLgKxdk8bM1HcwgOQmIdsONOefSMlvV2szWspRQlWIM/LZ+YZVG8 z1MA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:dkim-signature; bh=ddFX6WA7Vse1WsWNG5JUtWurIddg/WeWShq3oKWotbI=; fh=kcOaGNonvCFLlDY4K1K+nnfIcVnsWEaDbwS0yXUpYc8=; b=w1QhDTQBfpwU5a1twU+HwL3EgrhGAqRGD3587JsBKGiS7TdcK5YThY4+i1AHrvc/+d TI9RRxSd2JHOkc2KU615FAva6+1cJf11Y+Zl2Fsf8E3NzNkiTV1ZosuSja3+TGDekxUE 4U2eG3NV5qHmO43P2rD/n0JuDBfRDreb10JYl8N9PKMwaCRluFbf1Wwe5gVGM60mY+rg CMMTmUQXzKdQszkY+manATHZqzbnvLbXbTj2ng9M1yRXtf08siim5eyTKGHs67o6ah2R QC455qEZxFX4ijjgzDZRlV5jdwujqwjTMBPiBhWrJShdXUn6YCZG39dfK8wBanLHFLc/ PkSw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=KYewmMvm; arc=pass (i=1 spf=pass spfdomain=google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-122124-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-122124-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id c21-20020a056a000ad500b006e629ca2803si144642pfl.180.2024.03.27.15.54.20 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Mar 2024 15:54:20 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-122124-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=KYewmMvm; arc=pass (i=1 spf=pass spfdomain=google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-122124-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-122124-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 2845929B1AB for ; Wed, 27 Mar 2024 22:54:20 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B1D98153BED; Wed, 27 Mar 2024 22:53:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="KYewmMvm" Received: from mail-yw1-f172.google.com (mail-yw1-f172.google.com [209.85.128.172]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 29DF7153BD5 for ; Wed, 27 Mar 2024 22:53:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.172 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711580038; cv=none; b=vAEDG/TPMbnHKfAz+wf1PkB/VtRuJD4xtiEQxGDd6qaA9T9z72wDb9BVM+Rua9h7oIP15Ie0nEcoqOVR5HWET88eKaAdhA1GMEvuaRzMSJytZ4LMo6vjm8B9cnbcsII3BfypcC4uYzk4jYTLFFT74Cmc8DV3I4IZc2bZOSimASk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711580038; c=relaxed/simple; bh=ippSELgaRyUKakbXbpn0arphUywutW7eB+Upxu7AcEE=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=hym6+qAubzuSlsC7A/yV23snmBES4Ezi4mem9m3n72vQo50FCIrdNF2FKAFjOTFWwKzzhD3dxSPliVwcMXzMHKkVF6YSLjnm0toi69iroz6s1Ed3Aan5NFO1Lo+DuML3hNsT1ezVxbK4FVxw5yDTQL71SdDYDPgMAAz6eHbCDTY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=KYewmMvm; arc=none smtp.client-ip=209.85.128.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=google.com Received: by mail-yw1-f172.google.com with SMTP id 00721157ae682-609f1f97864so4173687b3.0 for ; Wed, 27 Mar 2024 15:53:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1711580035; x=1712184835; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=ddFX6WA7Vse1WsWNG5JUtWurIddg/WeWShq3oKWotbI=; b=KYewmMvmb3rOnZ/lt9sqYPiXvG9/UqqkM/vdJbQa8BxC20jBCkB+OUkqorM8ZaT5Of toWq+d5aZEzQ5jqtYKUwFTQc0QwMcHYQPtVUNZDyK5QEVDP1tVxxUzS3YA2NY5PetQaI MI6yCs96ZH37+YdpfqYpU37ShSD8KjtTHi+AnMDOOLXvxXX+wM6pfjQG5zMY0hfP++Kx UwbwWq2egI0x9Y8ASJd4e93Z+7uIDkD6eNS4Oa+xGMWI6EjAqzucoawvo4LmlRCX+OGm t3Cwp5le2DSjx9rqxDBNPWBcLoDoR2CflrCLZ+5faD7I/m5MPXJ/38yzjxW9wVsXK9Jz fuXQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711580035; x=1712184835; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ddFX6WA7Vse1WsWNG5JUtWurIddg/WeWShq3oKWotbI=; b=WGQodtmf6ToyuYC6bv1xPh7F4ynkCtD8G+kXQk+hL3mkZHja6PvmNDN5+qP2Y7bzwM eshHxO+CdsCg6z4EqUcqXs02f3k6G0DDfKLVhql1mGL7kgbz5rNRNgh7aZvMC/fYuZWq F4AsevpRy+v8GIQ1YJ3XzofANDJKKXdPZkHX6YZq/XLZFLLcRU4/wo6zwooxYZW03nKC 2tnaVXG0iBit+m1xeaE89EvAiOQuF8KTcIU4g2JjmZSNAIXA8ZulMLmQMfQ8xSZ3Bn0k Xc/KyBvf/Z2WiWqwntBFRz2q4L7n5zr0Xt5VTsHsUI/yHAMZPZ2MCzk3a9y54JCPpyQB CBOQ== X-Forwarded-Encrypted: i=1; AJvYcCV7deFa3Mogd6oyv07kCo8NsoNpf7gf2WwXjvnknt54KKM/jQWoWS064x9lxTDg/Ema1mnIgxg0ynxLme8JsE0GXfurWlilaREkVB3C X-Gm-Message-State: AOJu0Yx1q775F5HGh4Fnao/nTF1+UrjN59ywGv8vuzNFfSG2kWnj+sAQ I/TZGPEXqWwCt9NlNAIMarRhHVCgPnp0u4t6rjwmtnOGB0xMm2uSzdgqIUerT6E/Uq81/pvBiqY gh+648cWMvsmgc7V9pRQnSlcEVV3BGiIOcj5q X-Received: by 2002:a05:6902:136d:b0:dcc:97e4:bc61 with SMTP id bt13-20020a056902136d00b00dcc97e4bc61mr1324930ybb.57.1711580033859; Wed, 27 Mar 2024 15:53:53 -0700 (PDT) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240327213108.2384666-1-yuanchu@google.com> In-Reply-To: From: Yuanchu Xie Date: Wed, 27 Mar 2024 15:53:39 -0700 Message-ID: Subject: Re: [RFC PATCH v3 0/8] mm: workingset reporting To: Gregory Price Cc: David Hildenbrand , "Aneesh Kumar K.V" , Khalid Aziz , Henry Huang , Yu Zhao , Dan Williams , Huang Ying , Wei Xu , David Rientjes , Greg Kroah-Hartman , "Rafael J. Wysocki" , Andrew Morton , Johannes Weiner , Michal Hocko , Roman Gushchin , Muchun Song , Shuah Khan , Yosry Ahmed , Matthew Wilcox , Sudarshan Rajagopalan , Kairui Song , "Michael S. Tsirkin" , Vasily Averin , Nhat Pham , Miaohe Lin , Qi Zheng , Abel Wu , "Vishal Moola (Oracle)" , Kefeng Wang , linux-kernel@vger.kernel.org, linux-mm@kvack.org, cgroups@vger.kernel.org, linux-kselftest@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Wed, Mar 27, 2024 at 2:44=E2=80=AFPM Gregory Price wrote: > > On Wed, Mar 27, 2024 at 02:30:59PM -0700, Yuanchu Xie wrote: > > I realize this does not generalize well to hotness information, but I > > lack the intuition for an abstraction that presents hotness in a useful > > way. Based on a recent proposal for move_phys_pages[2], it seems like > > userspace tiering software would like to move specific physical pages, > > instead of informing the kernel "move x number of hot pages to y > > device". Please advise. > > > > [2] > > https://lore.kernel.org/lkml/20240319172609.332900-1-gregory.price@memv= erge.com/ > > > > Please note that this proposed interface (move_phys_pages) is very > unlikely to be received upstream due to side channel concerns. Instead, > it's more likely that the tiering component will expose a "promote X > pages from tier A to tier B", and the kernel component would then > use/consume hotness information to determine which pages to promote. I see that mm/memory-tiers.c only has support for demotion. What kind of hotness information do devices typically provide? The OCP proposal is not very specific about this. A list of hot pages with configurable threshold? Access frequency for all pages at configured granularity? Is there a way to tell which NUMA node is accessing them, for page promotio= n? > > (Just as one example, there are many more realistic designs) > > So if there is a way to expose workingset data to the mm/memory_tiers.c > component instead of via sysfs/cgroup - that is preferable. Appreciate the feedback. The data in its current form might be useful to inform demotion decisions, but for promotion, are you aware of any recent developments? I would like to encode hotness as workingset data as well. > > The 'move_phys_pages' interface is more of an experimental interface to > test the effectiveness of this approach without having to plumb out the > entire system. Definitely anything userland interface should not be > designed to generate physical address information for consumption unless > it is hard-locked behind admin caps. > > Regards, > Gregory