Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp1014134rwb; Thu, 1 Dec 2022 11:08:16 -0800 (PST) X-Google-Smtp-Source: AA0mqf4agFHVdAVxR7hZ796cgHS2Y2tySBN3vXkizLhl0VQESVMcmCTKJPj1DBSJTAynKBXwTVgk X-Received: by 2002:a17:907:3c23:b0:7c0:c0c9:d7c7 with SMTP id gh35-20020a1709073c2300b007c0c0c9d7c7mr148296ejc.382.1669921696333; Thu, 01 Dec 2022 11:08:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669921696; cv=none; d=google.com; s=arc-20160816; b=aVvjXOfz9sKLRVVRZDJrVtaG/pE5FywJAlsyEtsa8qigdXZyeDbWgImAFrTbns4ZbX 36E1Zw2NWR+IDyVjZbfhQTqFTreZCM51B4JaTVwbndJ0RgVGDMabX4YxhgxslDGaCmvN KEjnlUo4jGiHZXaypeDIM6jp+oHE/k/N+B3yGvByDT3dWeU15zbeGIKWOgVjQqrBJkad FcIIuAI/Vpgo2aQnKoIeQ/LVxDvezGzk0JDfltOmbksy8ByNpXMelTNfPECcAaHs95F+ NrW8lEt7qTqCn3doDJ8a9sEEU1QPjALCDL0ZrEEHsQAjfuIKoB/YaOmB0y2RyE16IGL4 4NjA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=FJcBqkJuc1O3n5xY+XGahxTgpCrWh2DUx8QxErVJvjI=; b=nwL8dR8x+5Afm5XKNuW1T68HNrv52skiiclEVjh3HewAXqaeAKLaJgk2OoK3kiIPD9 7GIOzFzKNG3GoYF49Mi3n4py0ZobpFxNw8HyMi9ytH+QWVdvWgRWi5Q2iJVTAX8f7rRa 3YmwItf2HNolAQ6ZCfHtnr4jo9w35MFuvfHpdb+6TjTs/ererKV94dBWhrA9JKaZvaKu H5lRhhQOUUp28hnqUhzlg8eJ1p5/p6b9lmZFKNNOtIAXCSHL1Iwn+MEJ8e3EpXWsDPOS IoanQx9X1fMe+IcjOOx5J/76haHJBYdt/TZ80+W1AAbNn9FLuH2HKPsodwULhzSU61bM yzHw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel-dk.20210112.gappssmtp.com header.s=20210112 header.b=5ZelWTK9; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id qf34-20020a1709077f2200b0070fc7c9d71dsi4990845ejc.989.2022.12.01.11.07.55; Thu, 01 Dec 2022 11:08:16 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel-dk.20210112.gappssmtp.com header.s=20210112 header.b=5ZelWTK9; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229943AbiLASlS (ORCPT + 82 others); Thu, 1 Dec 2022 13:41:18 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38846 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229722AbiLASlQ (ORCPT ); Thu, 1 Dec 2022 13:41:16 -0500 Received: from mail-io1-xd2a.google.com (mail-io1-xd2a.google.com [IPv6:2607:f8b0:4864:20::d2a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 99E6ABB7E0 for ; Thu, 1 Dec 2022 10:41:15 -0800 (PST) Received: by mail-io1-xd2a.google.com with SMTP id b2so1612207iof.12 for ; Thu, 01 Dec 2022 10:41:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel-dk.20210112.gappssmtp.com; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=FJcBqkJuc1O3n5xY+XGahxTgpCrWh2DUx8QxErVJvjI=; b=5ZelWTK9N5aqGvkSgZAU0x3yqA3FgGhaYF70hbG1rXpM2OciDQ3QPvIoWnFsVCBsW7 nGSCU9A757Z7mGhq0N4B1OMMwAOwiiGEyn9wMuBwuSp2CxsOJsMgEw9tJ9jXuUbyS9PF HtmAM5Wsjwc+i5nrNuR0CO5t9OT3GqmNTuGFmxoc/wGVkVYxSZd8KyBHKPO2SLQIw2sa vbK//4f/er5pz2KCZTOonrELgX7vtUb/ygq5w6+M5GFsnjonzY1hkv2p7o8yEv6cNpvy ojv5o28x2Ds6RUBC8uDS/Av0RsDhYmgrrt0BsIMIbwKJ4TnUDiqdtdSAVrtA6sCra4Uo XyHQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=FJcBqkJuc1O3n5xY+XGahxTgpCrWh2DUx8QxErVJvjI=; b=hzQqgLBWV/yFVpEL9Fk1IkHu00CNEM+WtPGMEPldZCmqQCDvl7pnixEvb/U5m1Fo2I XqY5knuDohfL79k2K4sOt1eZG1WkZgijDnYotGEMZmyBTTIXipuBmhnixW9roxxnL5yp 8Epx2poMscQgoHwfy5IBGviWvb6+0uYEXnHNoC1D5oluMN9sjvOBOoaxwN8MiowR52cm aAcIlVfQL7sID97t9pp2KMeaX9z7qeFM2anVxrCdk1i+OZCadtxX53jlG7rNgBYYSZ40 kU62vYKDIS3qKeKcYVFbMBAKXEymNK/HQcpfo32QYVpZyX0gx7vaEQoHHa4frdEXDeYd F0Ug== X-Gm-Message-State: ANoB5pks2yWWYop/coRIrqNaUYtUV7FRd8c2auqKo12i45C3aDIdXGyj viDzyxm/m/f13kG+GcRGU/0atw== X-Received: by 2002:a02:5442:0:b0:389:d81a:1d80 with SMTP id t63-20020a025442000000b00389d81a1d80mr11528617jaa.80.1669920074867; Thu, 01 Dec 2022 10:41:14 -0800 (PST) Received: from [192.168.1.94] ([207.135.234.126]) by smtp.gmail.com with ESMTPSA id cn23-20020a0566383a1700b00374bf3b62a0sm1889875jab.99.2022.12.01.10.41.13 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 01 Dec 2022 10:41:14 -0800 (PST) Message-ID: Date: Thu, 1 Dec 2022 11:41:13 -0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux aarch64; rv:102.0) Gecko/20100101 Thunderbird/102.5.0 Subject: Re: [PATCH 6/6] eventpoll: add support for min-wait Content-Language: en-US To: Soheil Hassas Yeganeh Cc: linux-kernel@vger.kernel.org, netdev@vger.kernel.org, Willem de Bruijn , Shakeel Butt References: <20221030220203.31210-1-axboe@kernel.dk> <20221030220203.31210-7-axboe@kernel.dk> <4764dcbf-c735-bbe2-b60e-b64c789ffbe6@kernel.dk> <8d195905-a93f-d342-abb0-dd0e0f5a5764@kernel.dk> From: Jens Axboe In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.2 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,NICE_REPLY_A,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 12/1/22 11:39 AM, Soheil Hassas Yeganeh wrote: > On Thu, Dec 1, 2022 at 1:00 PM Jens Axboe wrote: >> >>>>> @@ -1845,6 +1891,18 @@ static int ep_poll(struct eventpoll *ep, struct epoll_event __user *events, >>>>> ewq.timed_out = true; >>>>> } >>>>> >>>>> + /* >>>>> + * If min_wait is set for this epoll instance, note the min_wait >>>>> + * time. Ensure the lowest bit is set in ewq.min_wait_ts, that's >>>>> + * the state bit for whether or not min_wait is enabled. >>>>> + */ >>>>> + if (ep->min_wait_ts) { >>>> >>>> Can we limit this block to "ewq.timed_out && ep->min_wait_ts"? >>>> AFAICT, the code we run here is completely wasted if timeout is 0. >>> >>> Yep certainly, I can gate it on both of those conditions. >> Looking at this for a respin, I think it should be gated on >> !ewq.timed_out? timed_out == true is the path that it's wasted on >> anyway. > > Ah, yes, that's a good point. The check should be !ewq.timed_out. The just posted v4 has the check (and the right one :-)) -- Jens Axboe