From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9B6EAC433DB for ; Fri, 8 Jan 2021 15:59:18 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 6C8E7239A1 for ; Fri, 8 Jan 2021 15:59:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726954AbhAHP7C (ORCPT ); Fri, 8 Jan 2021 10:59:02 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40582 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725806AbhAHP7C (ORCPT ); Fri, 8 Jan 2021 10:59:02 -0500 Received: from ZenIV.linux.org.uk (zeniv.linux.org.uk [IPv6:2002:c35c:fd02::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D1B4AC061380; Fri, 8 Jan 2021 07:58:21 -0800 (PST) Received: from viro by ZenIV.linux.org.uk with local (Exim 4.92.3 #3 (Red Hat Linux)) id 1kxu9P-008Nht-Tr; Fri, 08 Jan 2021 15:58:08 +0000 Date: Fri, 8 Jan 2021 15:58:07 +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: <20210108155807.GQ3579531@ZenIV.linux.org.uk> References: <20210108052651.GM3579531@ZenIV.linux.org.uk> <20210108064639.GN3579531@ZenIV.linux.org.uk> <245fba32-76cc-c4e1-6007-0b1f8a22a86b@kernel.dk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <245fba32-76cc-c4e1-6007-0b1f8a22a86b@kernel.dk> Sender: Al Viro Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org On Fri, Jan 08, 2021 at 08:13:25AM -0700, Jens Axboe wrote: > > Anyway, bedtime for me; right now it looks like at least for task == > > current we always want TWA_SIGNAL. I'll look into that more tomorrow > > when I get up, but so far it smells like switching everything to > > TWA_SIGNAL would be the right thing to do, if not going back to bool > > notify for task_work_add()... > > Before the change, the fact that we ran task_work off get_signal() and > thus processed even non-notify work in that path was a bit of a mess, > imho. If you have work that needs processing now, in the same manner as > signals, then you really should be using TWA_SIGNAL. For this pipe case, > and I'd need to setup and reproduce it again, the task must have a > signal pending and that would have previously caused the task_work to > run, and now it does not. TWA_RESUME technically didn't change its > behavior, it's still the same notification type, we just don't run > task_work unconditionally (regardless of notification type) from > get_signal(). It sure as hell did change behaviour. Think of the effect of getting hit with SIGSTOP. That's what that "bit of a mess" had been about. Work done now vs. possibly several days later when SIGCONT finally gets sent. > I think the main question here is if we want to re-instate the behavior > of running task_work off get_signal(). I'm leaning towards not doing > that and ensuring that callers that DO need that are using TWA_SIGNAL. Can you show the callers that DO NOT need it?