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=-5.3 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,NICE_REPLY_A, SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 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 7D4F4C433C1 for ; Mon, 22 Mar 2021 14:58:47 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 340C7619AB for ; Mon, 22 Mar 2021 14:58:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231330AbhCVO6P (ORCPT ); Mon, 22 Mar 2021 10:58:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55674 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231327AbhCVO6I (ORCPT ); Mon, 22 Mar 2021 10:58:08 -0400 Received: from mail-io1-xd32.google.com (mail-io1-xd32.google.com [IPv6:2607:f8b0:4864:20::d32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CB7BBC061574 for ; Mon, 22 Mar 2021 07:58:07 -0700 (PDT) Received: by mail-io1-xd32.google.com with SMTP id f19so14227940ion.3 for ; Mon, 22 Mar 2021 07:58:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel-dk.20150623.gappssmtp.com; s=20150623; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-language:content-transfer-encoding; bh=MnKWy4e716jN9BFkrglHVe+ZofZs4CThsMNsuF3GTbs=; b=BsBlGLL9K2MHVYH/l4f5/Glu4cbNC0DN3gaxdJBrZf1bJBKJjx/Zk4rm6OMpLFjuj3 l2jBBe/6seovqKu1ynAp+nK3kpOiYkAO0QGtYBAtJ/MqGLxYKGElBTCjbQ/C45DYER+X tu3RSX9Z+5pYr2R+uSCkm4/odPnKzjNOSidnTFrPeVLoPh9gjTscVdoRreHSE/MGJgPK rLEQFpJhaeeVUDDp+YohHfEn1LnVFEBDW9gTAOpzpspB9Zu7MRJ9nS/eC6uvDu6WdU/+ iWuogGgRtkQKJ9Uq3jNUXYMVWer5Aboxd0jsjn+OnU7FoDyog2Re1t4/eGrg0UBet66Y qk5Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=MnKWy4e716jN9BFkrglHVe+ZofZs4CThsMNsuF3GTbs=; b=MFJ5ZdNa9JjXUYrjxpv2dSTEphlqtHQa1WZAX0+hv/luHiVR9PUoFKvt6h4CnBleJj C36CPnZKs/sPWUqp38ZHuYEQLABPW0wfi29kKx5KpKWolK66mgTN7+sLhwlu7O4YTkb3 Ju0+o+9bufQp1H3kY7rmXEU+//ZuEozgFd+WSmQ45/f7oa0hrp1ezyws7VK1G98AjrUR NZrkulHzmwTPWNox4dig/F2DKIV/hvWoJ3NKzI/P55buHmOFp7sv/oNrfm9zfYjR49VE ZbmNdFxw4OB2QQIbg4mA7Ptqm6I5/W7Cf+QLdn7leLoKmKLD4SG4cWiZhVZB8w1yf2yE yatg== X-Gm-Message-State: AOAM530f/E/et6SMRysIjBDVL5meVPRieQYqAU9HOGPmMIRnfS8pq2aG 2/LwXFubDZJRlbM8G4fRZ8gLUqBS1zvj6Q== X-Google-Smtp-Source: ABdhPJz+yNURMPJFh7IJ3RbW4n63ANmsxGInRNHkEtYUvuhcskpzELhtlYNftDF1WmsYE7YyfMcOkg== X-Received: by 2002:a5d:9245:: with SMTP id e5mr111338iol.97.1616425087070; Mon, 22 Mar 2021 07:58:07 -0700 (PDT) Received: from [192.168.1.30] ([65.144.74.34]) by smtp.gmail.com with ESMTPSA id 23sm7977190iog.45.2021.03.22.07.58.06 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 22 Mar 2021 07:58:06 -0700 (PDT) Subject: Re: [PATCH 03/11] io_uring: optimise out task_work checks on enter To: Pavel Begunkov , io-uring@vger.kernel.org References: <75e9acac-7fb7-747c-9832-3abcd0dfdfd9@gmail.com> From: Jens Axboe Message-ID: Date: Mon, 22 Mar 2021 08:58:06 -0600 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: <75e9acac-7fb7-747c-9832-3abcd0dfdfd9@gmail.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: io-uring@vger.kernel.org On 3/22/21 8:53 AM, Pavel Begunkov wrote: > On 22/03/2021 13:45, Jens Axboe wrote: >> On 3/21/21 7:58 PM, Pavel Begunkov wrote: >>> io_run_task_work() does some extra work for safety, that isn't actually >>> needed in many cases, particularly when it's known that current is not >>> exiting and in the TASK_RUNNING state, like in the beginning of a >>> syscall. >> >> Is this really worth it? > > Not alone, but ifs tend to pile up, and I may argue that PF_EXITING in > the beginning of a syscall may be confusing. Are you afraid it will get > out of sync with time? Not really worried about it, just don't like that we end up with two functions for running the task_work, where one has a check the other one does not. -- Jens Axboe