Received: by 2002:a5d:9c59:0:0:0:0:0 with SMTP id 25csp2300687iof; Wed, 8 Jun 2022 01:53:17 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxO1qYYKDHWNDvurUFSEOKBdF2i/VzwKik7bfx2l9SuZ6IO4+J6LH7Cvm38Y14IpU9oadWh X-Received: by 2002:a17:902:ab8c:b0:167:4d5c:3542 with SMTP id f12-20020a170902ab8c00b001674d5c3542mr24920882plr.6.1654678397079; Wed, 08 Jun 2022 01:53:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654678397; cv=none; d=google.com; s=arc-20160816; b=AstcmlNrsTNARAR4vibJup27EGYY4RD2VOXYRQj88Q6iK/zMy49ZIz3k8SxRXCV4vP CjwYlR9XVzpXQKyCyl7GxkgapT+vLcP9IiTZUHqlmrv0MLVN5UbIDFQQcMYXVPYVTgXk UbVVxO84J2gHV+UPQpoccLWfuFCDb2agcuag71dTr7knGw7gik13UGTHdLlkC3dRqS6m xtwRXzm5bssJpWDjzjLlpT3oAiOUGZdwMJ0hYzz1LsSo/xDMHqG8QGSZ/Bgt18qyo9TY zRvTkQjgmLsWzNOx5DI95Uf7Vo8wQhbSVGwmZx0u7KfaPFnNbpXCB8jzZl8c0tSZ61CF EwLA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=rJ6WQDvo/ghYzvKy2CXcM9QlclDOXoOl2dxAYdwMlz8=; b=FzWfRUemv+rvVz9HTqNigTjo7RTEozEVwt5J0WbQ1u2RArICwvwv1q91fndqcInV85 QYmi8A/zMPc4SqEZs+UCyVz++xXMHt4nEdKtXQqgmtGNhYHOCAgHmqcBM2GFjc6PEd3n aNiM1hyKzM4SrYjwJ4PL498gbdmFNyC4mZWCgVipabK4+ymHf7xqPufjcYi/exn2pmK+ hQPQE6ier93FfMZ5CFGEA1AImcNIRD7Wmq3xsz6XNJIjZz4aE063nixyfbMtS/AbkdcG ko/hQq5cHQvovLJdi1xsWV0FpO4eqXg15VCcdtwi9TDu6RbO3LdA4Q6bABj7pBeDlgUS a9/w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=KTQFE8GS; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id 19-20020a621413000000b0050cff7b2666si25179467pfu.241.2022.06.08.01.53.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 Jun 2022 01:53:17 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=KTQFE8GS; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id EE60A3C5022; Wed, 8 Jun 2022 01:16:11 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233445AbiFHGAR (ORCPT + 99 others); Wed, 8 Jun 2022 02:00:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33640 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1350798AbiFHF7e (ORCPT ); Wed, 8 Jun 2022 01:59:34 -0400 Received: from mx0a-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5626D20A5E2 for ; Tue, 7 Jun 2022 21:46:07 -0700 (PDT) Received: from pps.filterd (m0098416.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 2583Q2OC004968; Wed, 8 Jun 2022 04:41:43 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=message-id : date : mime-version : subject : to : cc : references : from : in-reply-to : content-type : content-transfer-encoding; s=pp1; bh=rJ6WQDvo/ghYzvKy2CXcM9QlclDOXoOl2dxAYdwMlz8=; b=KTQFE8GSa5W244tRx2pd/l8ZqUsfbtlXIUW4C8GQYFcrJYNayDLlxcWSgKSBxZkvt89G ktsBL0OaqoEKzw8VzFncKTpLZ6mu2ztjioEiBLMkGwOzUTDAOCt4Y5KnsaUdSClR68MY oDKuedJPQWLUzK7qg8y0NOD6IRIavRONrxGaBWM01pjqXK8+ibj0gaxXDvokOhvxuRS1 3z97L1n8zk0KFobRGiZdPp1M9huSDMdx8TxVw6WInEuSsCYvTSfs+w2azkMuFxJ+Q+rH xZUQLf4ZvqjdzfAl1I2uEheYK+pTBYUz/tVeGlKpNgOiR2X9QGSMtzE2mqw5VL2pvsW5 YA== Received: from pps.reinject (localhost [127.0.0.1]) by mx0b-001b2d01.pphosted.com (PPS) with ESMTPS id 3gjkv116mc-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 08 Jun 2022 04:41:42 +0000 Received: from m0098416.ppops.net (m0098416.ppops.net [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 2584QnsJ032205; Wed, 8 Jun 2022 04:41:42 GMT Received: from ppma01fra.de.ibm.com (46.49.7a9f.ip4.static.sl-reverse.com [159.122.73.70]) by mx0b-001b2d01.pphosted.com (PPS) with ESMTPS id 3gjkv116kh-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 08 Jun 2022 04:41:41 +0000 Received: from pps.filterd (ppma01fra.de.ibm.com [127.0.0.1]) by ppma01fra.de.ibm.com (8.16.1.2/8.16.1.2) with SMTP id 2584JurH006904; Wed, 8 Jun 2022 04:41:39 GMT Received: from b06cxnps4075.portsmouth.uk.ibm.com (d06relay12.portsmouth.uk.ibm.com [9.149.109.197]) by ppma01fra.de.ibm.com with ESMTP id 3gfy19bkny-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 08 Jun 2022 04:41:39 +0000 Received: from d06av21.portsmouth.uk.ibm.com (d06av21.portsmouth.uk.ibm.com [9.149.105.232]) by b06cxnps4075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 2584fbm946924056 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 8 Jun 2022 04:41:37 GMT Received: from d06av21.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 4E1C85204E; Wed, 8 Jun 2022 04:41:37 +0000 (GMT) Received: from [9.43.53.124] (unknown [9.43.53.124]) by d06av21.portsmouth.uk.ibm.com (Postfix) with ESMTP id E1DF252050; Wed, 8 Jun 2022 04:41:30 +0000 (GMT) Message-ID: <21b95ac3-4b3c-3455-93c6-8257fcbff527@linux.ibm.com> Date: Wed, 8 Jun 2022 10:11:29 +0530 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.10.0 Subject: Re: RFC: Memory Tiering Kernel Interfaces (v3) Content-Language: en-US To: Tim Chen , Jonathan Cameron , Ying Huang Cc: Wei Xu , Andrew Morton , Greg Thelen , Yang Shi , Davidlohr Bueso , Tim C Chen , Brice Goglin , Michal Hocko , Linux Kernel Mailing List , Hesham Almatary , Dave Hansen , Alistair Popple , Dan Williams , Feng Tang , Linux MM , Jagdish Gediya , Baolin Wang , David Rientjes References: <1281d918c07b05ac82aee290018ad08d212e0aaa.camel@intel.com> <20220530135043.00001e88@Huawei.com> From: Aneesh Kumar K V In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-TM-AS-GCONF: 00 X-Proofpoint-GUID: v_hnSuXru5-wSsQvbeDNUH7gYzDTmtde X-Proofpoint-ORIG-GUID: SYNUJXIZhqU9pu86pYCOxFy7_gM2EE7O X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.874,Hydra:6.0.517,FMLib:17.11.64.514 definitions=2022-06-08_01,2022-06-07_02,2022-02-23_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 impostorscore=0 clxscore=1015 malwarescore=0 bulkscore=0 spamscore=0 adultscore=0 phishscore=0 mlxscore=0 suspectscore=0 mlxlogscore=999 lowpriorityscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2204290000 definitions=main-2206080019 X-Spam-Status: No, score=-3.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, NICE_REPLY_A,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable 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 6/8/22 12:55 AM, Tim Chen wrote: > On Mon, 2022-05-30 at 13:50 +0100, Jonathan Cameron wrote: >> >>> When discussed offline, Tim Chen pointed out that with the proposed >>> interface, it's unconvenient to know the position of a given memory tier >>> in all memory tiers. We must sort "rank" of all memory tiers to know >>> that. "possible" file can be used for that. Although "possible" file >>> can be generated with a shell script, it's more convenient to show it >>> directly. >>> >>> Another way to address the issue is to add memtierN/pos for each memory >>> tier as suggested by Tim. It's readonly and will show position of >>> "memtierN" in all memory tiers. It's even better to show the relative >>> postion to the default memory tier (DRAM with CPU). That is, the >>> position of DRAM memory tier is 0. >>> >>> Unlike memory tier device ID or rank, the position is relative and >>> dynamic. >> >> Hi, >> >> I'm unconvinced. This is better done with a shell script than >> by adding ABI we'll have to live with for ever.. >> >> I'm no good at shell scripting but this does the job >> grep "" tier*/rank | sort -n -k 2 -t : >> >> tier2/rank:50 >> tier0/rank:100 >> tier1/rank:200 >> tier3/rank:240 >> >> I'm sure someone more knowledgeable will do it in a simpler fashion still. >> >> > > You can argue that > > $ cat /sys/devices/system/cpu/cpu1/topology/core_siblings > f > $ cat /sys/devices/system/cpu/cpu1/topology/core_siblings_list > 0-3 > > provide exactly the same information and we should get rid of > core_siblings_list. I think core_siblings_list exists to make > it easier for a human, so he/she doesn't have to parse the mask, > or write a script to find out the ids of CPUs who are siblings. > > I think in the same spirit, having an interface to allow a > human to quickly see the hierachical relationship of tiers > relative to each other is helpful. > We can add that later if we find applications requiring this. I kind of have the feeling that we are adding too much based on possible ways memory tiers could be used in the future. For now we can look at doing bare minimum to address the current constraints and drive more user visible changes later based on application requirements. -aneesh