From: Shawn Wang <shawnwang@linux.alibaba.com>
To: Reinette Chatre <reinette.chatre@intel.com>, fenghua.yu@intel.com
Cc: tglx@linutronix.de, mingo@redhat.com, bp@alien8.de,
dave.hansen@linux.intel.com, x86@kernel.org, hpa@zytor.com,
James Morse <james.morse@arm.com>,
jamie@nuviainc.com, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] x86/resctrl: Clear the stale staged config after the configuration is completed
Date: Mon, 24 Oct 2022 10:31:56 +0800 [thread overview]
Message-ID: <2cdfbe28-01cc-926d-2f6d-2a974a4c5a74@linux.alibaba.com> (raw)
In-Reply-To: <30637459-7419-6497-6230-b13c73a947de@intel.com>
Hi Reinette,
On 10/22/2022 2:05 AM, Reinette Chatre wrote:
...
>> It may not be enough to just clear staged_config[] when
>> resctrl_arch_update_domains() exits. I think the fix needs to make
>> sure staged_config[] can be cleared where it is set.
>>
>> The modification of staged_config[] comes from two paths:
>>
>> Path 1:
>> rdtgroup_schemata_write() {
>> ...
>> rdtgroup_parse_resource() // set staged_config[]
>> ...
>> resctrl_arch_update_domains() // clear staged_config[]
>> ...
>> }
>>
>> Path 2:
>> rdtgroup_init_alloc() {
>> ...
>> rdtgroup_init_mba()/rdtgroup_init_cat() // set staged_config[]
>> ...
>> resctrl_arch_update_domains() // clear staged_config[]
>> ...
>> }
>>
>> If we clear staged_config[] in resctrl_arch_update_domains(), goto
>> statement for error handling between setting staged_config[] and
>> calling resctrl_arch_update_domains() will be ignored. This can still
>> remain the stale staged_config[].
> ah - indeed. Thank you for catching that.
>
>>
>> I think maybe it is better to put the clearing work where
>> rdtgroup_schemata_write() and rdtgroup_init_alloc() exit.
>>
>
> It may be more robust to let rdtgroup_init_alloc() follow
> how rdtgroup_schemata_write() already ensures that it is
> working with a clean state by clearing staged_config[] before
> placing its staged config within.
>
I want to make sure, do you mean just ignore the stale value and place
the clearing work before staged_config[] is used? If so, maybe the only
thing the fix should do is to add memset() to rdtgroup_init_alloc().
Thanks,
Shawn
next prev parent reply other threads:[~2022-10-24 2:32 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-10-09 8:36 Shawn Wang
2022-10-11 23:48 ` Reinette Chatre
2022-10-20 5:55 ` Shawn Wang
2022-10-20 16:35 ` Reinette Chatre
2022-10-21 8:22 ` Shawn Wang
2022-10-21 18:05 ` Reinette Chatre
2022-10-24 2:31 ` Shawn Wang [this message]
2022-10-24 16:45 ` Reinette Chatre
2022-10-25 15:30 ` Shawn Wang
2022-10-25 19:34 ` Reinette Chatre
2022-10-26 11:03 ` Shawn Wang
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=2cdfbe28-01cc-926d-2f6d-2a974a4c5a74@linux.alibaba.com \
--to=shawnwang@linux.alibaba.com \
--cc=bp@alien8.de \
--cc=dave.hansen@linux.intel.com \
--cc=fenghua.yu@intel.com \
--cc=hpa@zytor.com \
--cc=james.morse@arm.com \
--cc=jamie@nuviainc.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=reinette.chatre@intel.com \
--cc=tglx@linutronix.de \
--cc=x86@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome