linux-arch.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Martin Schwidefsky <schwidefsky@de.ibm.com>
To: Oleg Nesterov <oleg@redhat.com>
Cc: linux-arch@vger.kernel.org, Andrew Morton <akpm@linux-foundation.org>
Subject: Re: [RFC][PATCH] s390: add arch_change_pid for arch updates after task pid change
Date: Thu, 19 Apr 2018 16:20:56 +0200	[thread overview]
Message-ID: <20180419162056.6b657d71@mschwideX1> (raw)
In-Reply-To: <20180419140729.GA19917@redhat.com>

On Thu, 19 Apr 2018 16:07:29 +0200
Oleg Nesterov <oleg@redhat.com> wrote:

> On 04/19, Martin Schwidefsky wrote:
> >
> > In a multi-threaded program any thread can call execve(). If this
> > is not done by the thread group leader, the de_thread() function
> > replaces the pid of the task that calls execve() with the pid of
> > thread group leader. If the task reaches user space again without
> > going over __switch_to() the sampling tag is still set to the old
> > pid.  
> 
> If this is the only reason for arch_change_pid() hook, then perhaps
> it would be better/simpler to add it into de_thread() right after
> change_pid(tsk, PIDTYPE_PID, task_pid(leader)) ?
> 
> note also that this way arch_change_pid() doesn't need any checks and
> any arguments, you can simply do
> 
> void arch_change_pid(void)
> {
> 	S390_lowcore.current_pid = current->pid;
> 	if (test_facility(40))
> 		lpp(&S390_lowcore.lpp);
> }

Yeah, the first patch I created to verify that this indeed the problem
basically looked like your proposal. But then why not make it a more
general hook for any kind of PID change? Dunno if this is a worthwhile
approach, the simpler version for sure works as well.

-- 
blue skies,
   Martin.

"Reality continues to ruin my life." - Calvin.

  reply	other threads:[~2018-04-19 14:21 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-19  6:44 [RFC][PATCH] s390: add arch_change_pid for arch updates after task pid change Martin Schwidefsky
2018-04-19 14:07 ` Oleg Nesterov
2018-04-19 14:20   ` Martin Schwidefsky [this message]
2018-04-19 16:08     ` Oleg Nesterov
2018-04-20  8:12       ` Martin Schwidefsky

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=20180419162056.6b657d71@mschwideX1 \
    --to=schwidefsky@de.ibm.com \
    --cc=akpm@linux-foundation.org \
    --cc=linux-arch@vger.kernel.org \
    --cc=oleg@redhat.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).