Received: by 2002:a05:6a10:2785:0:0:0:0 with SMTP id ia5csp417644pxb; Fri, 8 Jan 2021 08:13:32 -0800 (PST) X-Google-Smtp-Source: ABdhPJw3gkFeFjmxa9sRxq2L3g8PncNRzMWn/pnl2RuFUE5vSUFHU66v0zIG/qf+xs5WftypYihC X-Received: by 2002:a05:6402:2066:: with SMTP id bd6mr5755106edb.211.1610122412178; Fri, 08 Jan 2021 08:13:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1610122412; cv=none; d=google.com; s=arc-20160816; b=uum/yTG36ocRw7I8zDynJfIMMFi2R9IzLJTqbmDSxe6xrlTKWFN11gUnLtmR/t/yjx +V5fjvL1nNA5fSEE1U/TlPU+UF3TnrwqhR+TVNddXIwS4+sTyJevHiYwOKGngU85AcRW pJgLtq/eUGeOq6yV7IjbykF7jHH5tpCtSI2Xx6kI1Ut9BHBaWMOKekhD+fYUuHCNvoml 6kNI+Y/HVxOJxurO3IIO5DPo2JncHQXKnRBiTcZc4ReSS6xgDMpcOUOQ+tc7IUA860nl hAPOZ1feomT1tYjMNtg/P1SZPqRrAuw15DRpnd+eN99LiFKHaOPxSvDk4LQXr716zRt1 4Y/w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature; bh=0QGPFasA/mlJ8O6Agjy43TljTX1e0tfJqweWTwBQCFU=; b=pPx2077t7YpHeCocw4JXqr83dIF1nymYnq5rvMeHFDutlIRZf1KlxBI2cMrx/L2pn3 diJdsx9xyDH9NqNXRGgAVySLx60HbxT5sTf2W8OtriPHgGYQJ908amGOdvKgOgK+e15M /U4bCpD81Zdk30REyxtypx9MThJKL8DaHAaIRzed0lZ/oTgtTlkH/b1KHzsKsnL+3K9Z dLfEZkjwR1hia3TUArAzMWQ14PS0CCVzFotTup+z9CWyb0d7r4APoZ3tFdSxp9UKyOFK TjwBmItrhspQW5XVB0Hds/iX84D89zgi4KsUD1yyEKyu7q7IklqtdBLmn2Frlif84q/y G+0A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel-dk.20150623.gappssmtp.com header.s=20150623 header.b=n9S3cb75; 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 n27si3525315ejh.345.2021.01.08.08.13.07; Fri, 08 Jan 2021 08:13:32 -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; dkim=pass header.i=@kernel-dk.20150623.gappssmtp.com header.s=20150623 header.b=n9S3cb75; 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 S1727725AbhAHQLF (ORCPT + 99 others); Fri, 8 Jan 2021 11:11:05 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42474 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726906AbhAHQLF (ORCPT ); Fri, 8 Jan 2021 11:11:05 -0500 Received: from mail-il1-x134.google.com (mail-il1-x134.google.com [IPv6:2607:f8b0:4864:20::134]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 22425C061380 for ; Fri, 8 Jan 2021 08:10:25 -0800 (PST) Received: by mail-il1-x134.google.com with SMTP id h3so3047510ils.4 for ; Fri, 08 Jan 2021 08:10:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel-dk.20150623.gappssmtp.com; s=20150623; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=0QGPFasA/mlJ8O6Agjy43TljTX1e0tfJqweWTwBQCFU=; b=n9S3cb75C6AQyMA3YNYpDX2VpVNFC6yHQsWvikKFoDKLrApx61lf6wW7LIF2BUx3I6 Rs059J9SohrXtAHaw5hh5XYS9f3qxdyHPKfYIDwS6Gj9pEzyntLiTWuGCX+fVjJ+OrfC /jZQW66aEXGJWXsD76p46GW2DD8X4jewww30FSG7RYD4SHc8gQtVLyKxpTTxhbCvK4GK jnZylauIPgRxAJVEVhZlwsS8lpocW7nQUJL47YyG1w+4B7Rcrt45l7ItLVYoU5R4nFUK GHrWSAbZru6d7oPHyOZCwCFrgn/g5nA2LU7hdmWUZD7ndB7FgKdlx+Df/zbfYFst7qIy iVAw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=0QGPFasA/mlJ8O6Agjy43TljTX1e0tfJqweWTwBQCFU=; b=KaBcUyGwjFMuLPJPHP8vYAPvuwZlUsXnlKnp7nLTfSEnqmJsp/ALwWknJOoT87Yw5Y cp2zlbQKbEQYYtDPCt9iBEIA4Scp9mSAKroflw5fOgmq7610yTb32nkctoqpeS9MfM6s sK1oUbEboz6RV7KPf0ZKJ/zccwm5sdZOqCckfrf8TFU35RgDJoHtIWmf1yjdyCcIob8e yNWfjw1rtD37ZTxrWU8yGt9+EpVT/2yDoebjwfR4KUYtsCC6Afl/t4KNn53cPtv0n27T gohIZ5OSCGgrbzPa+YjbnWLKBJjMHtUx/oK50/1VRHzdQCsef72mPYRRnCd31B9F+NPO 2dyw== X-Gm-Message-State: AOAM533ezMVyPpsFbZC/5lN+iP/aJ2s/FVxkphLn7/farDQFJha9zigS RnFjBpYN6TfGbDPLpfck75BsEQ== X-Received: by 2002:a92:4002:: with SMTP id n2mr4341557ila.293.1610122224353; Fri, 08 Jan 2021 08:10:24 -0800 (PST) Received: from [192.168.1.30] ([65.144.74.34]) by smtp.gmail.com with ESMTPSA id d5sm7419122ilf.33.2021.01.08.08.10.23 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 08 Jan 2021 08:10:23 -0800 (PST) Subject: Re: [PATCH] fs: process fput task_work with TWA_SIGNAL To: Al Viro Cc: linux-fsdevel , "linux-kernel@vger.kernel.org" , Oleg Nesterov , Song Liu 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> From: Jens Axboe Message-ID: <41e33492-7b01-6801-cbb1-78ecef0c9fc0@kernel.dk> Date: Fri, 8 Jan 2021 09:10:23 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: <20210108155807.GQ3579531@ZenIV.linux.org.uk> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 1/8/21 8:58 AM, Al Viro wrote: > 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? 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? -- Jens Axboe