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=-8.4 required=3.0 tests=DKIMWL_WL_MED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,USER_IN_DEF_DKIM_WL 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 64CDCC2BA80 for ; Tue, 7 Apr 2020 17:52:48 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 2CEAD2075E for ; Tue, 7 Apr 2020 17:52:48 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="NIXY8CXP" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726277AbgDGRws (ORCPT ); Tue, 7 Apr 2020 13:52:48 -0400 Received: from mail-lf1-f67.google.com ([209.85.167.67]:40340 "EHLO mail-lf1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726332AbgDGRwr (ORCPT ); Tue, 7 Apr 2020 13:52:47 -0400 Received: by mail-lf1-f67.google.com with SMTP id j17so3078396lfe.7 for ; Tue, 07 Apr 2020 10:52:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=5c+CsqAqLUBl/bSdRYKSg7oIgz5eOMt76Z/m3+AosYI=; b=NIXY8CXPCgS3KfqaSC0tW1TS2ToYNRp1TMzg+k5lBuY7c/LgDUW5IKTXbE5KKPCAtS IU+2Qo7ejuH4WA5khGOsaMgJYnL1Iemy3R+CRRp094dTkaot6Dxc+vDS4UzcCqeaXaor dW71E4g18Rlmds67pAE8YJfRT0B4rjHUtcl0nYuTzJr9rXqLewRGdmaf3+K0OjKsSbeT /jiuynlteoYoJ/BAmGOS1zn5ogcmX9bfjKJXe4vah7+kagr4fP7oQbQtGAqGKlPUr4vt /8dcBV8nE+fGD2vAuJSmzc4apQD+QVByUM2N/aKwiNf7k9dCpMEYZxxDW/sixcGmWqwv QeoA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=5c+CsqAqLUBl/bSdRYKSg7oIgz5eOMt76Z/m3+AosYI=; b=psbFtQa+7i3l34XNiAc8R7ECgR+rKF4QDSCybnjXHCGxSVPmi4dH3blU7jn9RESjbD BIIEIhzn78crIGmlt6jtn0MrGwysnEtNKheoPiMfOXFnEAaV9UZGCX2eXiuWnAbmUtOC y5rxcXJusQONsMc8rrDrhvEbDPz//4eByLiFtgU/QmL59XUhXaQsvYSo+YFDocbQNIEm trklK+IuPrGs4eQ8wHFlmI2tlAzLBJep8Wk/UgR4FIArdtBOQ0WtbHr9siOAbsqWSi2l ZG4zgOd42+dl9RN4dozaf6Cv0MWbQOzG06LaTKACk95qP0rWa6dEmNR4GfV0j5H+FJqb 9WxA== X-Gm-Message-State: AGi0PuYzHeoxGYuSU0J2zGKg6aMg2uzVKBi9mU2L3jP2qjHHMTEsFzNK QoLhR1cckP3GOuAUGw1ADbGWr2WB6qe51si2Z4PcFw== X-Google-Smtp-Source: APiQypLwZb6L0pTn4O4Fua6Ds4vjJLPIXW1vpafkg81c5kdd35NLT6blZrvCprZjgvRmsvA9v0XcX48WX2DjFG2Ubn4= X-Received: by 2002:a19:3f89:: with SMTP id m131mr2147980lfa.141.1586281965571; Tue, 07 Apr 2020 10:52:45 -0700 (PDT) MIME-Version: 1.0 References: <20200407160258.933-1-axboe@kernel.dk> <20200407160258.933-2-axboe@kernel.dk> In-Reply-To: <20200407160258.933-2-axboe@kernel.dk> From: Jann Horn Date: Tue, 7 Apr 2020 19:52:19 +0200 Message-ID: Subject: Re: [PATCH 1/4] task_work: add task_work_pending() helper To: Jens Axboe Cc: io-uring , Al Viro , Oleg Nesterov , Peter Zijlstra Content-Type: text/plain; charset="UTF-8" Sender: io-uring-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: io-uring@vger.kernel.org On Tue, Apr 7, 2020 at 6:03 PM Jens Axboe wrote: > Various callsites currently check current->task_works != NULL to know > when to run work. Add a helper that we use internally for that. This is > in preparation for also not running if exit queue has been queued. [...] > +static inline bool task_work_pending(void) > +{ > + return current->task_works; > +} I think this should be using READ_ONCE().