mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Reinette Chatre <reinette.chatre@intel.com>
To: Peter Newman <peternewman@google.com>
Cc: <fenghua.yu@intel.com>, <bp@alien8.de>, <derkling@google.com>,
	<eranian@google.com>, <hpa@zytor.com>, <james.morse@arm.com>,
	<jannh@google.com>, <kpsingh@google.com>,
	<linux-kernel@vger.kernel.org>, <mingo@redhat.com>,
	<tglx@linutronix.de>, <x86@kernel.org>
Subject: Re: [PATCH v3 1/2] x86/resctrl: IPI all CPUs for group updates
Date: Wed, 23 Nov 2022 08:45:41 -0800	[thread overview]
Message-ID: <1b130af3-65fa-5a1c-cd07-5d2acacbd26a@intel.com> (raw)
In-Reply-To: <CALPaoCh9e5PB+fx2k6qBfOjduA01Rr2ZxdJFg4oocJtJ0aSYjQ@mail.gmail.com>

Hi Peter,

On 11/23/2022 3:09 AM, Peter Newman wrote:
> On Mon, Nov 21, 2022 at 10:53 PM Reinette Chatre
> <reinette.chatre@intel.com> wrote:
>> On 11/15/2022 6:19 AM, Peter Newman wrote:

...

>>> search the entire tasklist for group members which could be running on
>>> that CPU. This needs to be done while blocking updates to the tasklist
>>> to avoid leaving newly-created child tasks assigned to the old
>>> CLOSID/RMID.
>>
>> This is not clear to me. rdt_move_group_tasks() obtains a read lock,
>> read_lock(&tasklist_lock), so concurrent modifications to the tasklist
>> are indeed possible. Should this perhaps be write_lock() instead?
>> It sounds like the scenario you are describing may be a concern. That is,
>> if a task belonging to a group that is being removed happens to
>> call fork()/clone() during the move then the child may end up being
>> created with old closid.
> 
> Shouldn't read_lock(&tasklist_lock) cause write_lock(&tasklist_lock) to
> block?

Apologies, yes, you are right. I was focusing too much on the detail of
task_struct::tasks being a RCU list and lost sight of the actual lock
obtained (rcu_read_lock() vs read_lock()) in this instance. 

Reinette

  reply	other threads:[~2022-11-23 16:47 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-15 14:19 [PATCH v3 0/2] x86/resctrl: fix task CLOSID update race Peter Newman
2022-11-15 14:19 ` [PATCH v3 1/2] x86/resctrl: IPI all CPUs for group updates Peter Newman
2022-11-21 21:53   ` Reinette Chatre
2022-11-23 11:09     ` Peter Newman
2022-11-23 16:45       ` Reinette Chatre [this message]
2022-11-15 14:19 ` [PATCH v3 2/2] x86/resctrl: update task closid/rmid with task_call_func() Peter Newman
2022-11-21 21:59   ` Reinette Chatre
2022-11-22 15:17     ` Peter Newman
2022-11-22 21:13       ` Reinette Chatre

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=1b130af3-65fa-5a1c-cd07-5d2acacbd26a@intel.com \
    --to=reinette.chatre@intel.com \
    --cc=bp@alien8.de \
    --cc=derkling@google.com \
    --cc=eranian@google.com \
    --cc=fenghua.yu@intel.com \
    --cc=hpa@zytor.com \
    --cc=james.morse@arm.com \
    --cc=jannh@google.com \
    --cc=kpsingh@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=peternewman@google.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

all inboxes | Powered by JetHome®