Received: by 2002:a05:6a10:2785:0:0:0:0 with SMTP id ia5csp496419pxb; Fri, 8 Jan 2021 10:07:41 -0800 (PST) X-Google-Smtp-Source: ABdhPJwiFReEJlIIElJXA3qPAZ7MvZEjaoFh7vL56/YrXEdUtbnwhvfA9KoWajlBPk29NNAv5BIG X-Received: by 2002:a17:906:32d6:: with SMTP id k22mr3478782ejk.457.1610129261725; Fri, 08 Jan 2021 10:07:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1610129261; cv=none; d=google.com; s=arc-20160816; b=ypRTGTOequHw0oY+cYV86BTe+5KmlyADzcxhn9nrUwK6Z1+JdNwAxbl9m/LeTDnQfi jtGvOWLSgZBEjJMBiKu9ndSGD9Jv/R8P0Sx9st32a7vkrtjmI1ZcS+aIjLMMQrQh7UYU PZh/mPZYVneXVAEF2aR2fn0fWFD7NlVbQ309DtPdCKxdZ+dmU2dml5wF6d0Sx9ZvvNX8 mRJeBFo0GYYizMO7jshsCVEK+El11aPdo1yRIscPY5MfDVKRiANyxjzZE0WKSxDZW874 R8ekg87jtb1bypGGsboRLU9GvNXKSpPpVx2wpcJ+fRTxcCp5+q6QolFWL5/SZsQ94NmA X19Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=E8tWQN4K92IF+wSiusOWaB3aqPTj5L7VjGQqrwzXfP8=; b=di2eN6b6fLi6JfceYkDQoMPdJY4YDq4j+w8F7A7X0M31CLANBOb+JCllpk7xxNaiZ3 35A+IjsJkRNV6V9NqIrVZj0j+37pHM170qxzr23Guit+/oqOykNW4ZztJAKS1IrXwbCm 5aUYYGVkviG/B/p/WQjEsUeqG7F1rpTWfbkwoAwHdrDrMXWJPxRoICqTqqq4cTmh9ELM 5L81vcHsJcFU/ABq8zj4kQTvIWwhB0Z42OKQnEeUSKzIhJEX3YWQrbnC/hScX4wP0Our HRkPw0azLRUsundBb+k2T/PkGuFRkp3g/m0H45tohHoPCSaT3LbiF7ew6aV420NwL2SL Q8ww== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d14si4009119edj.545.2021.01.08.10.07.16; Fri, 08 Jan 2021 10:07:41 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728529AbhAHSGd (ORCPT + 99 others); Fri, 8 Jan 2021 13:06:33 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60380 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728442AbhAHSGd (ORCPT ); Fri, 8 Jan 2021 13:06:33 -0500 Received: from ZenIV.linux.org.uk (zeniv.linux.org.uk [IPv6:2002:c35c:fd02::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 705BFC061381; Fri, 8 Jan 2021 10:05:53 -0800 (PST) Received: from viro by ZenIV.linux.org.uk with local (Exim 4.92.3 #3 (Red Hat Linux)) id 1kxw8l-008PGL-MG; Fri, 08 Jan 2021 18:05:35 +0000 Date: Fri, 8 Jan 2021 18:05:35 +0000 From: Al Viro To: Jens Axboe Cc: linux-fsdevel , "linux-kernel@vger.kernel.org" , Oleg Nesterov , Song Liu Subject: Re: [PATCH] fs: process fput task_work with TWA_SIGNAL Message-ID: <20210108180535.GR3579531@ZenIV.linux.org.uk> References: <20210108052651.GM3579531@ZenIV.linux.org.uk> <20210108064639.GN3579531@ZenIV.linux.org.uk> <245fba32-76cc-c4e1-6007-0b1f8a22a86b@kernel.dk> <20210108155807.GQ3579531@ZenIV.linux.org.uk> <41e33492-7b01-6801-cbb1-78ecef0c9fc0@kernel.dk> <2cdd6d47-7eb1-3ab1-7aa8-80c54819009b@kernel.dk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <2cdd6d47-7eb1-3ab1-7aa8-80c54819009b@kernel.dk> Sender: Al Viro Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jan 08, 2021 at 09:26:40AM -0700, Jens Axboe wrote: > >> Can you show the callers that DO NOT need it? > > > > OK, so here's my suggestion: > > > > 1) For 5.11, we just re-instate the task_work run in get_signal(). This > > will make TWA_RESUME have the exact same behavior as before. > > > > 2) For 5.12, I'll prepare a patch that collapses TWA_RESUME and TWA_SIGNAL, > > turning it into a bool again (notify or no notify). > > > > How does that sound? > > Attached the patches - #1 is proposed for 5.11 to fix the current issue, > and then 2-4 can get queued for 5.12 to totally remove the difference > between TWA_RESUME and TWA_SIGNAL. > > Totally untested, but pretty straight forward. Umm... I'm looking at the callers of get_signal() and I really wonder how your support for TIF_NOTIFY_SIGNAL interacts with saved sigmask handling by various do_signal() (calls of restore_saved_sigmask()). Could you give pointers to relevant discussion or a braindump on the same? I realize that it had been months ago, but... Do we even need restore_saved_sigmask_unless() now? Could set_user_sigmask() simply set TIF_NOTIFY_SIGNAL? Oleg, could you comment on that? Another fun question is how does that thing interact with single-stepping logics; it's been about 8 years since I looked into those horrors, but they used to be bloody awful... What I'm trying to figure out is how costly TIF_NOTIFY_SIGNAL is on the work execution side; task_work_add() side is cheap enough, it's delivery that is interesting.