Received: by 2002:a05:7412:2a8c:b0:e2:908c:2ebd with SMTP id u12csp2265361rdh; Tue, 26 Sep 2023 19:02:27 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHrf4zlnWsDwBo+5ZcCwG7IwY5SzmzWPfV+AjGXU81+kpzx+tNiZWk9S39c3tDQXrQ0FITU X-Received: by 2002:a17:903:5cd:b0:1c4:72c9:64ef with SMTP id kf13-20020a17090305cd00b001c472c964efmr420700plb.40.1695780147251; Tue, 26 Sep 2023 19:02:27 -0700 (PDT) Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [23.128.96.33]) by mx.google.com with ESMTPS id f4-20020a170902684400b001bbc855a8fcsi13363882pln.488.2023.09.26.19.02.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Sep 2023 19:02:27 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) client-ip=23.128.96.33; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b="Fv+o/1oc"; arc=fail (signature failed); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id D956581F9646; Tue, 26 Sep 2023 17:55:12 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233331AbjI0AzJ (ORCPT + 99 others); Tue, 26 Sep 2023 20:55:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36234 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233628AbjI0AxH (ORCPT ); Tue, 26 Sep 2023 20:53:07 -0400 Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.65]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 31B7F93F4; Tue, 26 Sep 2023 15:14:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1695766485; x=1727302485; h=message-id:date:subject:to:cc:references:from: in-reply-to:content-transfer-encoding:mime-version; bh=caz7/tC7rOobkBGGqDTpY/LDudW6QnKOwHJ6w5igPnY=; b=Fv+o/1ocNQoPq9CCciQcK7uddYs8eR7QO2l9sZV8q9l+IoVUFXOeTZkX hLECj80QU/CoJtBhKipv6IfQAJRQy3Jp1mKFBeQbmRIOVNvoBZ5MPI4Jk PTjc5sHcMHhj9t4G3ZrWehk28DgtjMYj2sSzow51rqBX2LR0QocOFQZrK vzB8bEpfDHzCJ89MEUrxFHED/eGvf74fpoi+JkDdUpZJziya+K8CUdLUh aLJRxUv8Ul21e0gVopD4o7/AhJOyPD6DCI/65vSDfoaBeeInPxrSf+HNp eOzLOe4v/+tvKkuH4PXxu9JqfCv0AGGShXBwstebmRyxjcdK4/SOrXpRh w==; X-IronPort-AV: E=McAfee;i="6600,9927,10845"; a="385530720" X-IronPort-AV: E=Sophos;i="6.03,179,1694761200"; d="scan'208";a="385530720" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Sep 2023 15:01:06 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10845"; a="778298823" X-IronPort-AV: E=Sophos;i="6.03,179,1694761200"; d="scan'208";a="778298823" Received: from orsmsx602.amr.corp.intel.com ([10.22.229.15]) by orsmga008.jf.intel.com with ESMTP/TLS/AES256-GCM-SHA384; 26 Sep 2023 15:01:06 -0700 Received: from orsmsx610.amr.corp.intel.com (10.22.229.23) by ORSMSX602.amr.corp.intel.com (10.22.229.15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.32; Tue, 26 Sep 2023 15:01:05 -0700 Received: from ORSEDG601.ED.cps.intel.com (10.7.248.6) by orsmsx610.amr.corp.intel.com (10.22.229.23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.32 via Frontend Transport; Tue, 26 Sep 2023 15:01:05 -0700 Received: from NAM10-MW2-obe.outbound.protection.outlook.com (104.47.55.107) by edgegateway.intel.com (134.134.137.102) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.32; Tue, 26 Sep 2023 15:01:05 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=WV62Xu2kkz3Rww13R9byIK42teBVltobAygS2GEHA8mCn9XhW0XQFZFhEWlr/8qX1ap6vW7i4sAp9GmXQNBZ0V4ijnif4Put+gucCv9aEZ43hwfIPcrTeZZ1iiJAZaE1X8g5SH2rbQF/gbDzJqVi0Ns+l4bXKylP+EwFRFQ8fsEYWXX5QPmD2DxpvcdVEO0WgWlGcrDGCFrKqafFGoE08M4g0Ss9DX1gz3mLJ7DoqY3QfonnxSXw0zUkViVTqc98Bzha1FXASo65PkfRJ+rCgFDkECRc+zJf6v1rMgE0mou/zf2u69VxPxJPw7ctyR7d911XyR/Xqi9L/bec6YCL2Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=M4G7+LQRPzqu4vqk8t16CjMbJJin8N4ios/K6vPLFyQ=; b=H/PwRbbyOJF+HWm0PRk8esygBaESdCw3uzVQhrhk+//DgI84kIe3aRsJgUq0J0CF5//5CAGtURti90c41e57X1El6KK+ePiK98a8Jkd2b69SvkS856AYpVLYn+fTZXLBUcWk83XesFVYeE27EE0V532vwss0hE2EjpgrudbR9TQKLmbM7hkorhWE5Ldh7nABed0gUovqu3Lx4ePGkol2mE+U3xm0q/2xYayI978kTln0P99h1bksspuSrXSN5qADIumgqHXdhFn5g23Ve61K1ixIlweFgc/wzyCUAq11dV6b3EBdXZEX/6XMVAQYZgwSzjGjozdGERYkwBA+6BFXBA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; Received: from SJ2PR11MB7573.namprd11.prod.outlook.com (2603:10b6:a03:4d2::10) by CH0PR11MB5538.namprd11.prod.outlook.com (2603:10b6:610:d5::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6813.23; Tue, 26 Sep 2023 22:01:02 +0000 Received: from SJ2PR11MB7573.namprd11.prod.outlook.com ([fe80::bd70:f215:4a97:c84e]) by SJ2PR11MB7573.namprd11.prod.outlook.com ([fe80::bd70:f215:4a97:c84e%6]) with mapi id 15.20.6813.017; Tue, 26 Sep 2023 22:01:01 +0000 Message-ID: <5b2fd31e-3cef-3c35-7d17-411cea27502a@intel.com> Date: Tue, 26 Sep 2023 15:00:39 -0700 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Firefox/102.0 Thunderbird/102.15.1 Subject: Re: [PATCH v5 3/8] x86/resctrl: Split the rdt_domain structure Content-Language: en-US To: Tony Luck CC: Fenghua Yu , Peter Newman , Jonathan Corbet , Shuah Khan , , Shaopeng Tan , James Morse , Jamie Iles , Babu Moger , Randy Dunlap , , , References: <20230722190740.326190-1-tony.luck@intel.com> <20230829234426.64421-1-tony.luck@intel.com> <20230829234426.64421-4-tony.luck@intel.com> <5f1256d3-737e-a447-abbe-f541767b2c8f@intel.com> From: Reinette Chatre In-Reply-To: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-ClientProxiedBy: MW4P222CA0021.NAMP222.PROD.OUTLOOK.COM (2603:10b6:303:114::26) To SJ2PR11MB7573.namprd11.prod.outlook.com (2603:10b6:a03:4d2::10) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ2PR11MB7573:EE_|CH0PR11MB5538:EE_ X-MS-Office365-Filtering-Correlation-Id: 67ec9a39-530f-483d-97b1-08dbbedc06a9 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: LYjdCB4QeBM+8i4KZK6KSQFrOnA6kLPxRAi3QbGsCbNN574O0Bi+BLGss141G4GnX3YYGCaH29UMF9MIMbYv38l50qzQaXWl9uC8RQrVRP3+FJK76Ljvo+0FAUyhAsc6k2WCM/8DtgexQvq0R+9rlEEl7kj5tOb0gmhEE4q3cClN4HMLE48JsS/FsjZ9zjLw1Uf4hoBC7VuoheMiD5pPIbc5jIgpLRTpwsjtsn5SGmpOLfcSC9bW0oUWt0lG/1m6XYTwnL6nljMtdA+nP6J08JKocqqypzsOKALEzIsMIbK6WUZhxrwAhvenlVPPYNVLEnnbitwW2APuCSvYM+RiopQVmdY+qnV7+jmioOTBWJ/j1bWYeguAFQhvxISzBe7HS/JgNU2Q7LSYjxe4i8FZZAM8S+N5L6aMRoV2lHyL/xzx5Am7TvBwy6ajryzFIwsSgM2sFez2becIVfjSeAVHAHWcOqO+hn+NF7N1ZRLSBL+4luSBuZvd135CdVd9JMX5uO4ir5jvr5ymYDqi40KGi1VRdpeqLuih2KbIGEUKgrl2xlYuZ+8O/krvA+ZgZQFPkfqVkgXfLsm4vrL3VLdxluOI0PS89LuJ4PZAlekd9MBePKkOS/+IIcltWPtyThO+1O53GCWKvdSZsHDhJ4ZZAA== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SJ2PR11MB7573.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(396003)(366004)(39860400002)(346002)(376002)(136003)(230922051799003)(186009)(451199024)(1800799009)(7416002)(31686004)(2906002)(5660300002)(6862004)(8936002)(44832011)(8676002)(4326008)(66946007)(66556008)(66476007)(478600001)(6666004)(6506007)(86362001)(6486002)(53546011)(2616005)(6512007)(31696002)(316002)(6636002)(26005)(38100700002)(41300700001)(36756003)(83380400001)(37006003)(54906003)(82960400001)(43740500002)(45980500001);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?UjZKWVlnMzY1dmdxRHUxOXNpYUxra2lzS0pnaTEvYUZ0d2ZpUHNHa1l4QzEy?= =?utf-8?B?TktlRUFMK2Vjb1BHM2JhUDlzKzJlNm5UMGdXd1hPTmRSTmNGT2tJZXk5Rldh?= =?utf-8?B?ODhEQUtNazFobFhQcDRvakJQRVZqRHBVL1I3Mzc4cUJwb0JOZkRKS3BSdzcx?= =?utf-8?B?U1VEd1FlNnQ1b3lQelBjOHd6V01kOFdCUWFER1JadE5pb1Y1VmdDbTdrR09q?= =?utf-8?B?MjIwd3J5YkJRdFNPL0FlOVIyZk1yVWZPUGRQMmhHREVONEZJNmFYcU41MXhB?= =?utf-8?B?UTk2aWE4TWhEakhIN1dUM3hSWDJQcHpuUVRBVzJaNExEd0xhUkZkTGo0NE1y?= =?utf-8?B?L25UR2wrUlNUVmxRWVFpUDRPdHhmYUtwN2FtSnpibUJLYURUTXZaSjBPLzE5?= =?utf-8?B?eDFsVHkyaDVQWlNvNDhGUnRibXd5YnQ5YXlYUzQ4YVdBL1JHdWdiZCtKV055?= =?utf-8?B?UGRUSkVYaUF3OWFvZml4TlZ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.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Sep 2023 22:01:01.1332 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: L/VQaGwDFAfaD0jZtbJaHloMYmvUkHsDAT0La064o3WZVErRc97HXenNaiodP/GOt4FVOEoRiBf4ckbbpmT+f3tXhYCtoPuQzeL9kYYGSy4= X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH0PR11MB5538 X-OriginatorOrg: intel.com X-Spam-Status: No, score=-2.3 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.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 (lipwig.vger.email [0.0.0.0]); Tue, 26 Sep 2023 17:55:13 -0700 (PDT) Hi Tony, On 9/26/2023 11:46 AM, Tony Luck wrote: > On Mon, Sep 25, 2023 at 04:25:15PM -0700, Reinette Chatre wrote: >>> +struct rdt_domain { >>> + // First three fields must match struct rdt_mondomain below. >> >> Please avoid comments within declarations. Even so, could you please >> elaborate what the above means? Why do the first three fields have to >> match? I understand there is common code, for example, __rdt_find_domain() >> that operated on the same members of the two structs but does that >> require the members be in the same position in the struct? >> I understand that a comment may be required if position in the struct >> is important but I cannot see that it is. > > [Just replying to this one point in your message to get guidance. I'll > address all the rest in other replies] > > I'm wrong about the first *three* fields ... but the first *two* fields > (the "list" and the "id") do need to be at the same offsets in different > structures if a common routine is going to be used to access those > fields. > > If the "id" were at offset 0x10 in the control version of the domain > structure, and at offset 0x20 in the monitor version of the domain > structure, there would be no hope for a common routine to access the > "id" field when searching a list that could be either control or > monitor domains. > > I'm looking at making this far more explicit with a new patch between > 0001 and 0002 that pulls the two fields into a common substructure that > will be included in each of the control and monitor versions of the > structure. > > Patch included below. > > But this seems like it is a lot of churn to avoid having separate > functions to search control and monitor lists. Each a clone of > the existing ~24 line rdt_find_domain() with just the type changed > for the return value and the list travsersal. Yes. Sorry, I did not realize this implication during the earlier discussions. > > What do you think? > It sounds to me as though you are advocating for open coding rdt_find_ctrl_domain() and rdt_find_mon_domain()? That sounds good to me. Sorry for the noise. Reinette