Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp1023260iob; Fri, 13 May 2022 20:01:58 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxd7ZxjJEBHiAVs135usSBXt6xFx889wQZZ+J2BuDhGmK8t8HQHO066iNoEa+BYY7S3Xhk3 X-Received: by 2002:a05:6000:154a:b0:20c:7e65:c79e with SMTP id 10-20020a056000154a00b0020c7e65c79emr6137493wry.582.1652497318525; Fri, 13 May 2022 20:01:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652497318; cv=none; d=google.com; s=arc-20160816; b=eRF3DNfgSQGL54tJYYmEMSw7DnfLvcFLbgKcyCNBqAXGAMbGoKmOiZ9Qe8pXsvZ/i7 CVVdP/0Cvj9uDLyTMg8oyzeI1fnKyVkX+K0kVRGenyQimBBLcrbOeCt9XxiV2JLsMjFp rJwPk25rP9EebcqVKtqVIsImWGIYNy0ecKd3n+EGlI6BFKMyGzW/Bat2HSZUmzVJbdmG h4qx4UKUCby3djFq0JTjQc9ZCzgARBN80I46ehB40gIxtb8j2QknvohGN86OtwJlhFDJ vNNHrsu4eLlcff6GX72vjcD/okNhjbF6/RLra0cYcXWZNg0ZFqhU4HEcA3GL0rqfE3aa 6tTQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=AAEvdTjpMiH02kk60TytbztnqV1ZmA0Yb2xj1ek1p2c=; b=w4BnYwvh/+uJjuGJNhhLvFBOCs1IgrtMANlxMxbBF+IRzR/8o+gIBOasXIorFRLiWs vAxlNsFnMaMXxlyNBK1ASUiYLbSmdF659KvBXpKZysQbREpeQdNJ42CRfrkAdUEDpR23 cr8bPs4KUG9EwRVl0bwjJkVKlb+7M45BrZQTtScVHT61rNPdjVd5sADLQ3leU7dTwiMK S43OTych90L+YgG/Guw+2/UcFG6ak8XXdS/rkEXgQ+h5cBfjHYwMLSf6nBnidgkx/Kbh lCN/DKIUjLrUD90aoROQhSryyqiPcqqxsfMd2b54AqHPoagaa9reQZPK80fH0deKoCz7 6EOg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=AQd8ugEB; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id i13-20020a5d584d000000b002061176e61bsi3970601wrf.1057.2022.05.13.20.01.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 May 2022 20:01:58 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=AQd8ugEB; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 91C773A55F6; Fri, 13 May 2022 16:45:06 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1358740AbiELVcG (ORCPT + 99 others); Thu, 12 May 2022 17:32:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54208 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1358745AbiELVcD (ORCPT ); Thu, 12 May 2022 17:32:03 -0400 Received: from mail-ua1-x930.google.com (mail-ua1-x930.google.com [IPv6:2607:f8b0:4864:20::930]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 152B520F74F for ; Thu, 12 May 2022 14:32:01 -0700 (PDT) Received: by mail-ua1-x930.google.com with SMTP id q4so2523437uas.0 for ; Thu, 12 May 2022 14:32:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=AAEvdTjpMiH02kk60TytbztnqV1ZmA0Yb2xj1ek1p2c=; b=AQd8ugEBqMeVcQ3c+P4owmAOI3jptgmmv/yVY0Hzubgs1BBkmPok2U3o4M4aCk+f9G bEmzXF7EAuns52hfOWdAIBe2eeGl6SJHg2wuaNag32vrrilFFSFqQw9E+vCOmlJuaYJL znmmUGgr18xmZC9qrjprWUDXibliidJx8DxzkUX7xZfi1wajzi/WYEIikt9z8aUiT5cp pMqJnOziS0on8jMnrq2brRt0OI3EtBN33RdO1PHJCzBAhjL7EjDjPEJmdwGSwheiA/tK 9cWCtEnahNxMgy0+sd0rvPJWcdzATvKC6vFKqbHb9wxLzNWiXts5Bx8pmjdUhPnDXY27 pdOQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=AAEvdTjpMiH02kk60TytbztnqV1ZmA0Yb2xj1ek1p2c=; b=37ot6hAoo7b/nolW/C/+XL0QHFLW5mOZX1RwGjnE8L6W5Nh5TT77qMMdbPRlaW/z6t tUC9M8V/Ekap1dP66jUNbQNSneIiI9o+8A+gpmg+ukqlTQwvD6KlglKZkp1A4vzHFNaC rJqf8WST9dvf/xkJ+DS96oCTWuobJPe2sAv48jKc/h06G5dZ2Ug0zOp0xChRnwUYESTa cnZ2PxzSzXLKAKuoA7cssJ0OI8z6ed4gh7UGLu91RJMdFTya4Dig2zodCxal5yIa0E88 HCIsG5DfHb1QxrO1Ur2Wn24BYRC/zqjUZYYQeFjI0MF3U2v+ULKIbUyB2QrR3TqOcc0T xGdg== X-Gm-Message-State: AOAM532mJiTc/shFTtRIDT6clBR9jYDRGU/FQ0ZNr6vW/e5KjP+xvquT WQY0CvfvtLV/XJOeaXi/V53ftc4uXElZdvpbOBSvow== X-Received: by 2002:ab0:e14:0:b0:360:e13:e5d7 with SMTP id g20-20020ab00e14000000b003600e13e5d7mr1229790uak.95.1652391120104; Thu, 12 May 2022 14:32:00 -0700 (PDT) MIME-Version: 1.0 References: <56b41ce6922ed5f640d9bd46a603fa27576532a9.camel@intel.com> <87y1z7jj85.fsf@linux.ibm.com> <333438929a8680317bdae02da921d1e50fb9b0b3.camel@linux.intel.com> In-Reply-To: <333438929a8680317bdae02da921d1e50fb9b0b3.camel@linux.intel.com> From: Wei Xu Date: Thu, 12 May 2022 14:31:49 -0700 Message-ID: Subject: Re: RFC: Memory Tiering Kernel Interfaces (v2) To: Tim Chen Cc: "Aneesh Kumar K.V" , "ying.huang@intel.com" , Andrew Morton , Greg Thelen , Yang Shi , Linux Kernel Mailing List , Jagdish Gediya , Michal Hocko , Tim C Chen , Dave Hansen , Alistair Popple , Baolin Wang , Feng Tang , Jonathan Cameron , Davidlohr Bueso , Dan Williams , David Rientjes , Linux MM , Brice Goglin , Hesham Almatary Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-9.5 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE, USER_IN_DEF_DKIM_WL autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, May 12, 2022 at 2:13 PM Tim Chen wrote: > > On Thu, 2022-05-12 at 01:15 -0700, Wei Xu wrote: > > > > I am OK with moving back the memory tier nodelist into node/. When > > there are more memory tier attributes needed, we can then create the > > memory tier subtree and replace the tier nodelist in node/ with > > symlinks. > > > > So the revised sysfs interfaces are: > > > > * /sys/devices/system/node/memory_tierN (read-only) > > > > where N = 0, 1, 2 > > > > Format: node_list > > > > * /sys/devices/system/node/nodeN/memory_tier (read/write) > > > > where N = 0, 1, ... > > > > Format: int or empty > > This looks good to me. Just wonder if having just 1 tier > lower than DRAM is sufficient. We could have wide performance > range for such secondary memories and is one tier sufficient for them? > > Tim The tier design can be extended to more than 3 tiers (e.g. via CONFIG_MAX_MEMORY_TIERS). MAX_MEMORY_TIERS is set to 3 for now because without enough memory device performance information provided by the firmware, it is difficult for the kernel to properly initialize the memory tier hierarchy beyond 3 tiers (GPU, DRAM, PMEM). We will have to resort to the userspace override to set up such many-tier systems.