From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx3-rdu2.redhat.com ([66.187.233.73]:34072 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753624AbeDSOHb (ORCPT ); Thu, 19 Apr 2018 10:07:31 -0400 Date: Thu, 19 Apr 2018 16:07:29 +0200 From: Oleg Nesterov Subject: Re: [RFC][PATCH] s390: add arch_change_pid for arch updates after task pid change Message-ID: <20180419140729.GA19917@redhat.com> References: <1524120286-19066-1-git-send-email-schwidefsky@de.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1524120286-19066-1-git-send-email-schwidefsky@de.ibm.com> Sender: linux-arch-owner@vger.kernel.org List-ID: To: Martin Schwidefsky Cc: linux-arch@vger.kernel.org, Andrew Morton 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); } Oleg.