From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from frasgout.his.huawei.com (frasgout.his.huawei.com [185.176.79.56]) (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 0227E21CC58 for ; Mon, 5 Jan 2026 17:21:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.176.79.56 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1767633711; cv=none; b=nCP5lsnTub7/RS+qL5RkA65jVqwwjJip2Zsc2vAmvA/pioAR+yEUdNiVMnmFTtHOS7DnK9P6EyEE5wOH9+glzQe+soXMzSLU2nJ3tu6+j5NSBCWKvXbKYFQRq15xPHw+h8oa+zY1IewEEHGG9/lraYbWnqeSNuxNHxLA2mUHfnM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1767633711; c=relaxed/simple; bh=sHkHAwEDetWNKU8Wu2MxvDgYzGze5BeW1eDtM4xA4gU=; h=Date:From:To:CC:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=TZyT/K5sV6S6DnrCXMljiYgQlJcDz5B0gfmuKLy5tIg6sl2htqC7HUsovk7bkn4GJFGlxV32HV4FuYzQfJgxreTRRxBy/a/SVUKhTbRFTIxyZZmVW53DLG6J1NQZJWpAaU2sPoC7XNdpvsaLM9o4uKtdtHS+DmyGc9BBSfLBC4M= 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=185.176.79.56 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.18.224.107]) by frasgout.his.huawei.com (SkyGuard) with ESMTPS id 4dlLgr56kzzJ46DH; Tue, 6 Jan 2026 01:21:44 +0800 (CST) Received: from dubpeml100005.china.huawei.com (unknown [7.214.146.113]) by mail.maildlp.com (Postfix) with ESMTPS id ED53F40571; Tue, 6 Jan 2026 01:21:44 +0800 (CST) Received: from localhost (10.126.174.38) by dubpeml100005.china.huawei.com (7.214.146.113) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.36; Mon, 5 Jan 2026 17:21:43 +0000 Date: Mon, 5 Jan 2026 17:21:41 +0000 From: Jonathan Cameron To: Ben Horgan CC: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , Subject: Re: [PATCH v2 12/45] arm64: mpam: Add helpers to change a task or cpu's MPAM PARTID/PMG values Message-ID: <20260105172141.00006d06@huawei.com> In-Reply-To: <20251219181147.3404071-13-ben.horgan@arm.com> References: <20251219181147.3404071-1-ben.horgan@arm.com> <20251219181147.3404071-13-ben.horgan@arm.com> X-Mailer: Claws Mail 4.3.0 (GTK 3.24.42; x86_64-w64-mingw32) Precedence: bulk X-Mailing-List: kvmarm@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit X-ClientProxiedBy: lhrpeml500012.china.huawei.com (7.191.174.4) To dubpeml100005.china.huawei.com (7.214.146.113) On Fri, 19 Dec 2025 18:11:14 +0000 Ben Horgan wrote: > From: James Morse > > Care must be taken when modifying the PARTID and PMG of a task in any > per-task structure as writing these values may race with the task being > scheduled in, and reading the modified values. > > Add helpers to set the task properties, and the CPU default value. These > use WRITE_ONCE() that pairs with the READ_ONCE() in mpam_get_regval() to > avoid causing torn values. > > CC: Dave Martin > Signed-off-by: James Morse > Signed-off-by: Ben Horgan Reviewed-by: Jonathan Cameron