Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp1071466rwb; Thu, 1 Dec 2022 11:59:24 -0800 (PST) X-Google-Smtp-Source: AA0mqf67vb3oSZUAcJPmFkAr9dwCb+x81SeXqGiOJ7ldPJyvVpu/HKc2ytxLEGhAeQ3/+3HnTXKA X-Received: by 2002:a17:906:660d:b0:7ba:5085:864 with SMTP id b13-20020a170906660d00b007ba50850864mr34303534ejp.357.1669924763941; Thu, 01 Dec 2022 11:59:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669924763; cv=none; d=google.com; s=arc-20160816; b=DpLAo5Gx1IarODuIkIpHaMRgAMnoFTMSwOHyj1rpy/usrnR4XJOH/IPK7BV3H3OHkE UjWDOj8c/nn0+0rIU7Ak94TViYSHJVS230mHAQuADMaWfJv8CaXB+3bjTQKXnhBLUsfp Yy7/+LDWzud9ZtT2gSCFsGkpTRCIOJOdCQuvyPSngvnvN+mU1VZcbvnc4Hjei54D0iW+ MXjcXZuq8KPwVBSzpkj4D35RHQQEc+0zJrBOAzoTfl7rkqOBoOOYh55u8h5NcrwBDtMX 24PcSB3KeJeFu9u8N+61fFIuj7mF54AG80DAsQqDWxkgF/8z2oMLb5912/7uZiA5uHOx OXQw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=l0s48YnBzqizD/NOUNAFmcwcrFhU8sJJzTPVQzYJmbs=; b=v/fScRWpB+DeKVG/ltRX9jkaYV7yFeTd0mkXQPrcBc30oEzyqwuMPuEr/3opyWiSYm n1DOMonTjF0jPJWE/sAAYklng47jJt2ePYjJQ3JY9hYfIjE1Cn/UwYFDlx9qqW8qy4WF jP3Liw2LVIkQY4w6cL+0RfAyqTSoNblrR3QTYwt0BsuzKcOZSe+hFG7xNmBcNgKmyIl5 sPw1a4PUWE6ypo2EWk2BLc3nZeJKJcwQ9MeJZgJsDUYEYYFCL0ur4CxK6+a6n01cyA6w M8zEXQNPZRYZ1zBW/wOkGp5QuEkCRSCn0FwLIRM70DSSR8qHZmUF+lzqoEmdsWHowTFh 9kgA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b="mYDxZz5/"; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id di22-20020a170906731600b007aa493b067asi4491082ejc.396.2022.12.01.11.59.04; Thu, 01 Dec 2022 11:59:23 -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=@google.com header.s=20210112 header.b="mYDxZz5/"; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229713AbiLASkT (ORCPT + 82 others); Thu, 1 Dec 2022 13:40:19 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37888 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229943AbiLASkQ (ORCPT ); Thu, 1 Dec 2022 13:40:16 -0500 Received: from mail-yw1-x1133.google.com (mail-yw1-x1133.google.com [IPv6:2607:f8b0:4864:20::1133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6B78DBD422 for ; Thu, 1 Dec 2022 10:40:15 -0800 (PST) Received: by mail-yw1-x1133.google.com with SMTP id 00721157ae682-381662c78a9so26274207b3.7 for ; Thu, 01 Dec 2022 10:40:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=l0s48YnBzqizD/NOUNAFmcwcrFhU8sJJzTPVQzYJmbs=; b=mYDxZz5/zmyya/ckPo1fHDwM398Dq7zS9tCF2YcWRdqcVVcLACnSAn9/hNI2wpl4CF /RRs2yE+XsKr0n6dyswNlQJPyx5P7eq8rwJqNdKMlKnmPOTnmsfg0RyvdJjTzTgu0GpK P92Ceyz0crP15HrWHK3KErqrbOykl77zwrDOGUNj4emqOS+wHtfgesrlrdQq4zsY9nv5 U39cqeO/jQm8z5ZofD9evuur1dl7FuhFazI1FvsyV7x1k7YYF7Bu2ydbVtLfD0by5wT5 zpXS8Tj42uxeQhVel3gyrlyJ19ftEdzBErcR/OU3q1XybPnYwTOdVv7ryU8XgEfXVdtl gzoA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=l0s48YnBzqizD/NOUNAFmcwcrFhU8sJJzTPVQzYJmbs=; b=7gLR9iPnhCVppueGMVXBPKCga3JKEPj0Ua1eN1OXFqEgZAqHGG32NsZ9j6QEGO2/ih +hNR10V9D4TC1MpMrp/3cZ6VmogzCd7j6zGrFcDEQ4R6/gY/tJzW0DTuq0NB05ZklNRp pEZKIeM80q22iMqM7DYEaZB1X6yRP8AMLrSHVFc0lgSY1EVNrfWjKIm+vP2WogkjgH56 G+O+RwlUhWm4JLRSjWb862KuUkX6gzVEbnB3OhhZGpOxfZIfb+ohoejj4shgLijL6428 eCAzRFH8kl/Q74pcR2QCrWxRsGXphx+c3iS25qohtCW3VdHN99Eufev/9ziu52tH4cGi 0gow== X-Gm-Message-State: ANoB5plTFj/Zf1ZkmVtTDgkyo0NuIJBjysVDmMizIWeSYVqBHi18DqWk LJlLZ3z8Xz33dAwBEgPucbTz5tOI9YOQLOzJp/9xIg== X-Received: by 2002:a81:14c4:0:b0:3ac:3740:9452 with SMTP id 187-20020a8114c4000000b003ac37409452mr42942221ywu.471.1669920014388; Thu, 01 Dec 2022 10:40:14 -0800 (PST) MIME-Version: 1.0 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> In-Reply-To: <8d195905-a93f-d342-abb0-dd0e0f5a5764@kernel.dk> From: Soheil Hassas Yeganeh Date: Thu, 1 Dec 2022 13:39:37 -0500 Message-ID: Subject: Re: [PATCH 6/6] eventpoll: add support for min-wait To: Jens Axboe Cc: linux-kernel@vger.kernel.org, netdev@vger.kernel.org, Willem de Bruijn , Shakeel Butt Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-17.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, ENV_AND_HDR_SPF_MATCH,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, USER_IN_DEF_DKIM_WL,USER_IN_DEF_SPF_WL 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 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. Thanks, Soheil > -- > Jens Axboe >