From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755060AbcBZUTh (ORCPT ); Fri, 26 Feb 2016 15:19:37 -0500 Received: from mail-wm0-f41.google.com ([74.125.82.41]:38656 "EHLO mail-wm0-f41.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754023AbcBZUTg (ORCPT ); Fri, 26 Feb 2016 15:19:36 -0500 Subject: Re: [PATCH] Don't set sempid in semctl syscall. To: PrasannaKumar Muralidharan , akpm@linux-foundation.org, herton@redhat.com, penguin-kernel@i-love.sakura.ne.jp, rientjes@google.com, dave@stgolabs.net, joe@perches.com, linux-kernel@vger.kernel.org References: <1456489298-20224-1-git-send-email-prasannatsmkumar@gmail.com> From: Manfred Spraul Message-ID: <56D0B354.50106@colorfullife.com> Date: Fri, 26 Feb 2016 21:19:32 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.6.0 MIME-Version: 1.0 In-Reply-To: <1456489298-20224-1-git-send-email-prasannatsmkumar@gmail.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, On 02/26/2016 01:21 PM, PrasannaKumar Muralidharan wrote: > From: PrasannaKumar Muralidharan > > As described in bug #112271 (bugzilla.kernel.org/show_bug.cgi?id=112271) > don't set sempid in semctl syscall. Set sempid only when semop is called. I disagree with the bug report: sempid is (and always was on Linux) the pid of the last task that modified the semaphore: It is updated for semop, SETVAL and undo adjustment on process exit. And - that is a bug: sempid is not updated for SETALL :-( With regard to setting sempid on SETVAL, - Opensolaris sets sempid on SETVAL and SETALL http://minnie.tuhs.org/cgi-bin/utree.pl?file=OpenSolaris_b135/uts/common/syscall/sem.c - Darwin sets sempid on SETVAL and SETALL http://fxr.watson.org/fxr/source//bsd/kern/sysv_sem.c?v=xnu-1456.1.26 Note: For sem_otime and sem_ctime, there are also subtile differences between the sysv implementations. What should we do there? Here is my last review (already a few years old - some links may be stale, perhaps a few more implementations are now available) http://calculix-rpm.sourceforge.net/sysvsem.html -- Manfred