Received: by 2002:a05:7412:2a8c:b0:e2:908c:2ebd with SMTP id u12csp3876596rdh; Fri, 29 Sep 2023 05:14:52 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGSlyABe0jFedD2npc3R+Mxn/6j8wvapa98dMh5UdRrlBdUJwBJ47M8tqou/hZXk8p2smEK X-Received: by 2002:a05:6870:f10d:b0:1d5:40df:8fb1 with SMTP id k13-20020a056870f10d00b001d540df8fb1mr4602020oac.19.1695989692253; Fri, 29 Sep 2023 05:14:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695989692; cv=none; d=google.com; s=arc-20160816; b=bWqq2L21BdMwrEz3CFuUfcYZq+rGIfCbhtHyHAgqTuNJbqkGh3f+6QvW5H/Ha8kEGm eNK9vGfUg8p0RAoe4TKl7HKl7GmPEl2xu5j6duII0U/RH/f5VVQQif00wCd/m12C/ZOI usKQwObqR9vL4HiNtZCqw6wAu7DNpQcMjHE5qCgMSrjY2xnzSdGK8mTGL4NCbiR+gi1O TpJ/2sdQyyNA5UM7/Wck0HBf6xeleqaaYEag+OdpoWsmrYehZRa1wBHpNYqw9ZLU0T7O I5HA4pGZplB1uo4k8wmw/6TwgecOnbSXENLaoveClMucqd2qsC5Gtmh6+eC4O40mj5+q xFIw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=4tGzWMVpNkHmeXd9+StiHUNQluJqc763pD7utN+gAfM=; fh=fdbks9cDZD3nws6fbVmPJcsGIn1evRgsQgeNrttrtE4=; b=gMosFeTsUX0dEU+P0m4Hzn4VTnRvB+pVTYVacLSi6+jhIO9sSEPLibmDtrYZem1vmZ zNMSTq2h0ysA4soOEoKhR5gbMgmcCeDxxb2sNTMF5IVBEMA2q31njkcHY1P6KkxjMFl9 QnJRd8npt4BgdT7XUvAmQTSTflzOO52xcgCTvSvu2ErIzpMPy/b1gd5SGN5jeRT0+YDw FzFD7VCiBOyCqLd7b50sNUPUbJOHb/E8MFhzllJpbzlr5Fpm4ctYtqd0//nRq/pQqVpV qvGLkfgkz16B+GUt9rO+Fn5XN8P5z6bmoFFHQs9qK9u0t6XWVMShIzTRXgTMRwf329RM d34A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=lIZLGgc3; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 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 morse.vger.email (morse.vger.email. [23.128.96.31]) by mx.google.com with ESMTPS id n13-20020a65488d000000b005777bea0b6asi20847535pgs.859.2023.09.29.05.14.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Sep 2023 05:14:52 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) client-ip=23.128.96.31; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=lIZLGgc3; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 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 out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by morse.vger.email (Postfix) with ESMTP id 28A3180A9E37; Fri, 29 Sep 2023 05:10:13 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233197AbjI2MJ6 (ORCPT + 99 others); Fri, 29 Sep 2023 08:09:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40062 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233170AbjI2MJ5 (ORCPT ); Fri, 29 Sep 2023 08:09:57 -0400 Received: from mail-pl1-x633.google.com (mail-pl1-x633.google.com [IPv6:2607:f8b0:4864:20::633]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B95411AB for ; Fri, 29 Sep 2023 05:09:54 -0700 (PDT) Received: by mail-pl1-x633.google.com with SMTP id d9443c01a7336-1c6052422acso126965ad.1 for ; Fri, 29 Sep 2023 05:09:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1695989394; x=1696594194; 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=4tGzWMVpNkHmeXd9+StiHUNQluJqc763pD7utN+gAfM=; b=lIZLGgc3FGBDEM3LvSQV6xR4q+MYJR68AW3/OBOG30NyaDgJLCeWn6MVASZ1/4oTgm c+Uoaxfpz5qtMU+r9IV1WoFdGEv1HLzt7Q/MDNZXxeRzLzZfq5Z9nr4O4ofKPS3HP9DT BUgR3dUfXS5C0tRY5sGaTFPr2cTOYLLf8PqQ4HX+iLc2+ua/cg7ecF28EdZ4Los9j4e1 SktCelYfHDU9ahA0PTV2cPEeIaujRLFGJUlaF0gDSDKvdxRwLshN5abNxdbpailfqOcb eQem9aYEjWBzl38f/LSyP5OcIFf2DmrvJhnLqR2H0ochjdLivJB3NlLedu5wXKP0UqZh 6Y4w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695989394; x=1696594194; 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=4tGzWMVpNkHmeXd9+StiHUNQluJqc763pD7utN+gAfM=; b=onw9sqIn01MGrfkxTBBUalkTrHLEHNGotZJ5BdyMOUNkUFofQOMsjtrZCFOykcaUuX OhU+W627NcislueohUELhm/3fjgDEkicz+qPPOwACnVlH4kBiVv8iKW//+4Pfc9LEtSj Nu7QnMrYHT/zg320zy9jDV1jvWYe4/lMVG3wPim35Vt20uo2Uopo2qOglwFMu/CXzUwe Qu7Y7EVR9kZ2TAEE3K0QbOdrHyHGOCUq81GiZARDw0ZsoqIJDuPtnNnMrvljyKUuCjen eKxx4Dw9EeDCLYA1rxYW53iVrE/rybTjG6pQxylgFfv9lsqm8S1NpxNJdil5mFuZ1ats 2oTA== X-Gm-Message-State: AOJu0Yy7tHz0vhlVSEQuWzxHh7sFgvxWzBZ8/g1Yl4MtCChye7tFbI+l Uw2bJChh18MZj4BLWH5/u/4xF+t6oh0IvfADpmCjpA== X-Received: by 2002:a17:903:2447:b0:1bc:66f2:4bb with SMTP id l7-20020a170903244700b001bc66f204bbmr957738pls.8.1695989393847; Fri, 29 Sep 2023 05:09:53 -0700 (PDT) MIME-Version: 1.0 References: <20230829234426.64421-1-tony.luck@intel.com> <20230928191350.205703-1-tony.luck@intel.com> <20230928191350.205703-2-tony.luck@intel.com> In-Reply-To: <20230928191350.205703-2-tony.luck@intel.com> From: Peter Newman Date: Fri, 29 Sep 2023 14:09:42 +0200 Message-ID: Subject: Re: [PATCH v6 1/8] x86/resctrl: Prepare for new domain scope To: Tony Luck Cc: Fenghua Yu , Reinette Chatre , Jonathan Corbet , Shuah Khan , x86@kernel.org, Shaopeng Tan , James Morse , Jamie Iles , Babu Moger , Randy Dunlap , linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org, patches@lists.linux.dev Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-8.4 required=5.0 tests=DKIMWL_WL_MED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_IN_DEF_DKIM_WL autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on morse.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (morse.vger.email [0.0.0.0]); Fri, 29 Sep 2023 05:10:13 -0700 (PDT) Hi Tony, On Thu, Sep 28, 2023 at 9:14=E2=80=AFPM Tony Luck wro= te: > > Resctrl resources operate on subsets of CPUs in the system with the > defining attribute of each subset being an instance of a particular > level of cache. E.g. all CPUs sharing an L3 cache would be part of the > same domain. > > In preparation for features that are scoped at the NUMA node level > change the code from explicit references to "cache_level" to a more > generic scope. At this point the only options for this scope are groups > of CPUs that share an L2 cache or L3 cache. > > Provide a more detailed warning message if a domain id cannot be found > when adding a CPU. Just check and silent return if the domain id can't > be found when removing a CPU. > > No functional change. I see a number of diagnostic checks added below. Are you sure there's no functional change? > diff --git a/arch/x86/kernel/cpu/resctrl/pseudo_lock.c b/arch/x86/kernel/= cpu/resctrl/pseudo_lock.c > index 8f559eeae08e..8c5f932bc00b 100644 > --- a/arch/x86/kernel/cpu/resctrl/pseudo_lock.c > +++ b/arch/x86/kernel/cpu/resctrl/pseudo_lock.c > @@ -292,10 +292,14 @@ static void pseudo_lock_region_clear(struct pseudo_= lock_region *plr) > */ > static int pseudo_lock_region_init(struct pseudo_lock_region *plr) > { > + int scope =3D plr->s->res->scope; > struct cpu_cacheinfo *ci; > int ret; > int i; > > + if (WARN_ON_ONCE(scope !=3D RESCTRL_L2_CACHE && scope !=3D RESCTR= L_L3_CACHE)) > + return -ENODEV; Functional change? > diff --git a/arch/x86/kernel/cpu/resctrl/rdtgroup.c b/arch/x86/kernel/cpu= /resctrl/rdtgroup.c > index 725344048f85..1cf2b36f5bf8 100644 > --- a/arch/x86/kernel/cpu/resctrl/rdtgroup.c > +++ b/arch/x86/kernel/cpu/resctrl/rdtgroup.c > @@ -1345,10 +1345,13 @@ unsigned int rdtgroup_cbm_to_size(struct rdt_reso= urce *r, > unsigned int size =3D 0; > int num_b, i; > > + if (WARN_ON_ONCE(r->scope !=3D RESCTRL_L2_CACHE && r->scope !=3D = RESCTRL_L3_CACHE)) > + return -EINVAL; This function returns unsigned int. That's a huge region! -Peter