From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 24FC31D5ADC; Thu, 20 Feb 2025 14:57:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.140.110.172 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1740063446; cv=none; b=RYPi1Q4oe/aRWs8ULauI4QRUfNNz1JweHJIoHjCMKzrzxEke/e30+3Ejt8KaLBap/q3lFv7nKFmKCcor/ZoZXIVvkpBdGwmxuNndTGbzloySFdrSauAsWEFCUNU+BK280kSa1rYPD3x+AvfuFzir6ziLrSpaCLNS9IvJbJ8aNqc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1740063446; c=relaxed/simple; bh=4swTJhJme/kUIwO4pXe7KXlwM5vi2EDJ4oDb11ckgdA=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=pdd92+LJBeNYZSeYykoEdX0OHx4EEn6PjMhU9z2C0TG/qR7F0HBSFU0zPTaJBo2dSV70TUCHJpbvo0DRPFMAbffXphuBzj5WniHv0768CWo1Ups3zBGY6rVjCbVf4RhWJJYa0etQb4as/jxXX82xrWnR4/6kNvHbIOJQX6+znL4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com; spf=pass smtp.mailfrom=arm.com; arc=none smtp.client-ip=217.140.110.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=arm.com Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 354D816F3; Thu, 20 Feb 2025 06:57:41 -0800 (PST) Received: from e133380.arm.com (e133380.arm.com [10.1.197.43]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id EB30C3F59E; Thu, 20 Feb 2025 06:57:18 -0800 (PST) Date: Thu, 20 Feb 2025 14:57:16 +0000 From: Dave Martin To: "Luck, Tony" Cc: Babu Moger , "corbet@lwn.net" , "Chatre, Reinette" , "tglx@linutronix.de" , "mingo@redhat.com" , "bp@alien8.de" , "dave.hansen@linux.intel.com" , "peternewman@google.com" , "x86@kernel.org" , "hpa@zytor.com" , "paulmck@kernel.org" , "akpm@linux-foundation.org" , "thuth@redhat.com" , "rostedt@goodmis.org" , "xiongwei.song@windriver.com" , "pawan.kumar.gupta@linux.intel.com" , "daniel.sneddon@linux.intel.com" , "jpoimboe@kernel.org" , "perry.yuan@amd.com" , "sandipan.das@amd.com" , "Huang, Kai" , "Li, Xiaoyao" , "seanjc@google.com" , "Li, Xin3" , "andrew.cooper3@citrix.com" , "ebiggers@google.com" , "mario.limonciello@amd.com" , "james.morse@arm.com" , "tan.shaopeng@fujitsu.com" , "linux-doc@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "Wieczor-Retman, Maciej" , "Eranian, Stephane" Subject: Re: [PATCH v11 23/23] x86/resctrl: Introduce interface to modify assignment states of the groups Message-ID: References: Precedence: bulk X-Mailing-List: linux-doc@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: [Dropped Cc: fenghua.yu@intel.com (bounces)] On Wed, Feb 19, 2025 at 05:43:43PM +0000, Luck, Tony wrote: > > I hacked up something a bit like this so that schemata could be written > > interactively from the shell, so I can try to port that onto this series > > as an illustration, if it helps. > > Note that schemata will accept writes that just change the bits you want to change. > > So from the shell: > > # cat schemata > MB:0=100;1=100 > L3:0=fff;1=fff > > # echo "MB:1=90" > schemata > > # cat schemata > MB:0=100;1= 90 > L3:0=fff;1=fff > > -Tony > Yes, but not: # { p=: echo -n MB for ((d = 0; d < 2; d++)); do echo -n "$p$d=100" p=';' done echo } >schemata (Or at least, it depends on the shell. Each simple command that generates output can result in a separate write() call -- certainly there is no guarantee that it won't.) Doing the same thing from C will "work", because by default I/O on the schemata file will be fully buffered in userspace... unless the whole output exceeds the default buffer size. The difference from sysfs here is that it would be insane to write a small, single formatted value in pieces when it is natural to generate it from a single format specifier -- whereas the syntax of some of resctrl's files has a multilevel internal structure that has to be built up in a piecemeal fashion (whether or not it is written to the file in one go). I'm not saying that this is an issue for realistic uses though, and anyway, the schemata file is nothing to do with this series. Cheers ---Dave