linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Will Deacon <will@kernel.org>
To: KeMeng Shi <shikemeng@huawei.com>
Cc: akpm@linux-foundation.org, james.morris@microsoft.com,
	gregkh@linuxfoundation.org, mortonm@chromium.org,
	will.deacon@arm.com, kristina.martsenko@arm.com,
	yuehaibing@huawei.com, malat@debian.org, j.neuschaefer@gmx.net,
	linux-kernel@vger.kernel.org
Subject: Re: Re: [PATCH] connector: report comm change event when modifying /proc/pid/task/tid/comm
Date: Tue, 17 Sep 2019 18:07:38 +0100	[thread overview]
Message-ID: <20190917170737.dpchgliux4qi2qef@willie-the-truck> (raw)
In-Reply-To: <20190917135628.3054-1-shikemeng@huawei.com>

On Tue, Sep 17, 2019 at 09:56:28AM -0400, KeMeng Shi wrote:
> on 2019/9/17 at 5:10, Will Deacon wrote:
> >The rough idea looks ok to me but I have two concerns:
> >
> >  (1) This looks like it will be visible to userspace, and this changes
> >      the behaviour after ~8 years of not reporting this event.
> This do bother for users who only care the comm change via prctl, but it
> also benefits users who want all comm changes. Maybe the best way is add
> something like config or switch to meet the both conditions above. In my
> opinion, users cares comm change event rather than how it change.

I was really just looking for some intuition as to how this event is
currently used and why extending it like this is unlikely to break those
existing users.

> >(2) What prevents proc_comm_connector(p) running concurrently with itself
> > via the prctl()? The locking seems to be confined to set_task_comm().
> To be honest, I did not consider the concurrence problem at beginning. And
> some comm change events may lost or are reported repeatly as follows:
> set name via procfs	set name via prctl
> set_task_comm
> 			set_task_comm
> proc_comm_connector
> 			proc_comm_connector
> Comm change event belong to procfs losts and the fresh comm change belong
> to prctl is reported twice. Actually, there is also concurrence problem
> without this update as follows:
> set name via procfs	set name via prctl
> 			set_task_comm
> set_task_comm
> 			proc_comm_connector
> Comm change event from procfs is reported instead of prctl, this may
> bothers user who only care the comm change via prctl.

Perhaps, although given that proc_comm_connector() is currently only called
on the prctl() path, then it does at least provide the comm from the most
recent prctl() invocation. With your path, the calls can go out of order,
so I think that probably needs fixing.

Will

  reply	other threads:[~2019-09-17 17:07 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-16 14:13 [PATCH] connector: report comm change event when modifying /proc/pid/task/tid/comm KeMeng Shi
2019-09-16 21:10 ` Will Deacon
2019-09-17  2:36   ` KeMeng Shi
2019-09-17 13:56   ` KeMeng Shi
2019-09-17 17:07     ` Will Deacon [this message]
2019-09-19  2:43       ` KeMeng Shi
2019-09-19 20:07         ` Andrew Morton

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=20190917170737.dpchgliux4qi2qef@willie-the-truck \
    --to=will@kernel.org \
    --cc=akpm@linux-foundation.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=j.neuschaefer@gmx.net \
    --cc=james.morris@microsoft.com \
    --cc=kristina.martsenko@arm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=malat@debian.org \
    --cc=mortonm@chromium.org \
    --cc=shikemeng@huawei.com \
    --cc=will.deacon@arm.com \
    --cc=yuehaibing@huawei.com \
    /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;
as well as URLs for NNTP newsgroup(s).