Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp8306769ybi; Thu, 6 Jun 2019 09:59:29 -0700 (PDT) X-Google-Smtp-Source: APXvYqxdSwdAAzHzg/irYEXNe03WYMDEfrTj+qe1iT4nQfMESNPMpV0Uy6EWOAslX2zyJu2Ufwpc X-Received: by 2002:a63:5c1a:: with SMTP id q26mr4386265pgb.260.1559840369637; Thu, 06 Jun 2019 09:59:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559840369; cv=none; d=google.com; s=arc-20160816; b=sT3zkb42SPF5hCjWuwHbCecolr1PK/pUyfywPDhKlehNsjDUp+F3YaxFhlB3CtRZNo oFJ4NAyKotDhS4DFXIqjmTlMOC0e2+7xCQ/AUIvb8GqqkKsfnslPpCX3r74sBNadqbUn X0atNbb9G4FzSIMfcsp0jcwodmJSuoHpNeyaSkJNZoWtecbnr4IEXDqzPSq0Ps/lPHdB GppCYuCMhtVKeIL6gc7xZ/gs9VkrRJahjjfT278rNYWT51y1F70r/IN4KT9Uf3TFShyq 7Yxu3g2GQJgf9fpIKOKaAvJUj/VShmKt40jp3ndPBryCwpaQK9TC5doeu4xcOswK32Nk j35g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :content-language:accept-language:in-reply-to:references:message-id :date:thread-index:thread-topic:subject:cc:to:from; bh=6N5W9VBqf/uNLplBPNWvQNgRLd71kpaCqzMQlzGg3AY=; b=KJ3hgvYNwr7yxljFiorZKDHLwZPoiqWWGgl0bYyLdoTZeRnICHgS0MvDe2nDMlNkWu 2RJevicCpE/mDajIAYYvdFTYI8sau6kEwpWufBBQ6wZdnBha6PRW1RVrkCeeUGc5KiRG HlkHGNETJiIw/c5gXOpwYds2QTVH15jBxqX0otkggeZGsa9PCoz2pf+q//rI6MLD3Ox/ Bsbij+wOuuMrVbypEGgHvTCvdoP611VcQ6BhX+Alrtcv2TzNC5rmzuyr2Sz3/5xuBH0j F3gZ84AUQ2YyszI8n+pbjJ6AI/4XORKW4Nr9nb8wZKIWkrZVklIQhnQZfeGjZ2Y29lhW hnEA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n18si2397985pff.40.2019.06.06.09.59.13; Thu, 06 Jun 2019 09:59:29 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728444AbfFFL3y convert rfc822-to-8bit (ORCPT + 99 others); Thu, 6 Jun 2019 07:29:54 -0400 Received: from eu-smtp-delivery-151.mimecast.com ([146.101.78.151]:23501 "EHLO eu-smtp-delivery-151.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726926AbfFFL3y (ORCPT ); Thu, 6 Jun 2019 07:29:54 -0400 Received: from AcuMS.aculab.com (156.67.243.126 [156.67.243.126]) (Using TLS) by relay.mimecast.com with ESMTP id uk-mta-55-JlKKsqqGP-m_DvJJhUs1bQ-1; Thu, 06 Jun 2019 12:29:50 +0100 Received: from AcuMS.Aculab.com (fd9f:af1c:a25b:0:43c:695e:880f:8750) by AcuMS.aculab.com (fd9f:af1c:a25b:0:43c:695e:880f:8750) with Microsoft SMTP Server (TLS) id 15.0.1347.2; Thu, 6 Jun 2019 12:29:49 +0100 Received: from AcuMS.Aculab.com ([fe80::43c:695e:880f:8750]) by AcuMS.aculab.com ([fe80::43c:695e:880f:8750%12]) with mapi id 15.00.1347.000; Thu, 6 Jun 2019 12:29:49 +0100 From: David Laight To: 'Oleg Nesterov' CC: 'Linus Torvalds' , Andrew Morton , Deepa Dinamani , "Linux List Kernel Mailing" , Arnd Bergmann , Davidlohr Bueso , Jens Axboe , Davidlohr Bueso , "e@80x24.org" , Jason Baron , linux-fsdevel , "linux-aio@kvack.org" , "omar.kilani@gmail.com" , Thomas Gleixner , stable , Al Viro , "Eric W. Biederman" Subject: RE: [PATCH -mm 0/1] signal: simplify set_user_sigmask/restore_user_sigmask Thread-Topic: [PATCH -mm 0/1] signal: simplify set_user_sigmask/restore_user_sigmask Thread-Index: AQHVG8OiWeMKMn2zNEeA0y96arbBsKaOUFtAgAAW0gCAABcWoA== Date: Thu, 6 Jun 2019 11:29:49 +0000 Message-ID: <6e3eeb101a30431eb111ad739ab5d2b0@AcuMS.aculab.com> References: <20190522032144.10995-1-deepa.kernel@gmail.com> <20190529161157.GA27659@redhat.com> <20190604134117.GA29963@redhat.com> <20190605155801.GA25165@redhat.com> <1285a2e60e3748d8825b9b0e3500cd28@AcuMS.aculab.com> <20190606110522.GA4691@redhat.com> In-Reply-To: <20190606110522.GA4691@redhat.com> Accept-Language: en-GB, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-exchange-transport-fromentityheader: Hosted x-originating-ip: [10.202.205.107] MIME-Version: 1.0 X-MC-Unique: JlKKsqqGP-m_DvJJhUs1bQ-1 X-Mimecast-Spam-Score: 0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8BIT Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Oleg Nesterov > Sent: 06 June 2019 12:05 > On 06/06, David Laight wrote: > > > > If a signal handler is called, I presume that the trampoline > > calls back into the kernel to get further handlers called > > and to finally restore the original signal mask? > > See sigmask_to_save(), this is what the kernel records in uc.uc_sigmask > before the signal handler runs, after that current->saved_sigmask has no > meaning. Some of this code is hard to grep through :-) > When signal handler returns it does sys_rt_sigreturn() which restores > the original mask saved in uc_sigmask. Does that mean that if 2 signals interrupt epoll_wait() only one of the signal handlers is run? David - Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK Registration No: 1397386 (Wales)