From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from szxga05-in.huawei.com (szxga05-in.huawei.com [45.249.212.191]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id F26601A840F for ; Fri, 20 Dec 2024 09:36:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=45.249.212.191 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734687390; cv=none; b=ELYnMOVlCn+9Y/gAaK6v6/5wPvlzHqhKXZSfx/u7QRgju9dUU20IbpITgUBucXMzqyiyyG0rhZ8dgZWRTwHWp63hN+u9KM63SUmcO9ovnHOGfurCBT2c8u6rsQ8bW5RGKkAit3W/C/z1qa2yMmCVpKyfmQI+FomSlDV8LEcpavY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734687390; c=relaxed/simple; bh=wRAhvn6KyGXH0k5lv26LxXN73IZbBf/PVhpGo0oRqUU=; h=Message-ID:Date:MIME-Version:Subject:To:CC:References:From: In-Reply-To:Content-Type; b=dmwzyGPBrDqRGi7xHP/s5TvZ8gTLQE5sHP/5ef8erc8GmCMKch0cvskB+G3rPDa4DBJ9nnaPoDYNka+/nCW6hqQuZ0+/MX7erQh2DdCAm5h7OKrjAxjWDdLGJQzuqJW/t9GTBHyIGoLgtPTmnUloVC12JRxB9vcexJgdJwVqivE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com; spf=pass smtp.mailfrom=huawei.com; arc=none smtp.client-ip=45.249.212.191 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=huawei.com Received: from mail.maildlp.com (unknown [172.19.163.44]) by szxga05-in.huawei.com (SkyGuard) with ESMTP id 4YF2NJ3RsGz1JFv6; Fri, 20 Dec 2024 17:36:00 +0800 (CST) Received: from kwepemf100008.china.huawei.com (unknown [7.202.181.222]) by mail.maildlp.com (Postfix) with ESMTPS id 432311402C4; Fri, 20 Dec 2024 17:36:25 +0800 (CST) Received: from [10.174.179.163] (10.174.179.163) by kwepemf100008.china.huawei.com (7.202.181.222) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.11; Fri, 20 Dec 2024 17:36:24 +0800 Message-ID: <65e556b6-61e1-7d84-ab8a-becaf55dbb18@huawei.com> Date: Fri, 20 Dec 2024 17:36:23 +0800 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.11.0 Subject: Re: [RFC PATCH mpam mpam/snapshot/v6.12-rc1 v3 4/5] arm_mpam: Automatically synchronize the configuration of all sub-monitoring groups Content-Language: en-US To: Dave Martin CC: , , , , , "Wangshaobo (bobo)" References: <20241207092136.2488426-1-zengheng4@huawei.com> <20241207092136.2488426-5-zengheng4@huawei.com> From: Zeng Heng In-Reply-To: Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit X-ClientProxiedBy: dggems702-chm.china.huawei.com (10.3.19.179) To kwepemf100008.china.huawei.com (7.202.181.222) On 2024/12/13 0:18, Dave Martin wrote: > Hi, > >> @@ -3072,9 +3080,20 @@ struct mpam_write_config_arg { >> >> static int __write_config(void *arg) >> { >> + int closid_num = resctrl_arch_get_num_closid(NULL); >> struct mpam_write_config_arg *c = arg; >> + u32 reqpartid, req_idx; >> + >> + WARN_ON(c->partid >= closid_num); >> >> - mpam_reprogram_ris_partid(c->ris, c->partid, &c->comp->cfg[c->partid]); >> + /* Synchronize the configuration to each sub-monitoring group. */ >> + for (req_idx = 0; req_idx < get_num_reqpartid_per_closid(); >> + req_idx++) { >> + reqpartid = req_idx * closid_num + c->partid; >> + >> + mpam_reprogram_ris_partid(c->ris, reqpartid, >> + &c->comp->cfg[c->partid]); >> + } >> >> return 0; >> } > > I haven't decided whether this iteration belongs here or in > mpam_resctrl.c. > > Your approach looks like it should work; I do it in > resctrl_arch_update_one() instead [1], but I think the approaches are > pretty much equivalent -- but let me know if you have any thoughts on > it. > Yes, the actual functions of these two locations are essentially the same. However, at the __write_config position, we can reduce the repeated judgments of cfg[partid] in mpam_update_config() and also decrease the times of smp_call remote invocations. What about your option towards it? Best regards, Zeng Heng