Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp1047112ybh; Wed, 22 Jul 2020 21:51:20 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyXA0BSbO/TpD4NwqvHCmvyN0jE8+KJW+KQNeLkT73Iq2Io8Qdk63Q24Ht2bWSNVBTW3DV1 X-Received: by 2002:aa7:c341:: with SMTP id j1mr2607233edr.197.1595479880640; Wed, 22 Jul 2020 21:51:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595479880; cv=none; d=google.com; s=arc-20160816; b=g2p94MRne2r1vR+JLAk0pRElef4jQV5N9z7rSPzM/RDJKgCiQ7otfbHAAJxnEQfmZb t8Y0J54DlzYG+LwPgh8GZWOn+2maAalJVBxd2eTRwX/0qe+2Nx4aORP9GBgfCRnhvbyw EdNNPyivrf4jCv13Bob42MZNIQ4sWoFNtoqX7uKmzKmgKhIXAS/xDzW3ub8ZPEsp1L1F RSkEwiWgXY6hmAi6woOgEFgSb5wFUQRxhaJEh2YxWKGG+4xh0QdppSYDBzHMl9rAyOZ/ Uz0r9v/DZPRelW5RO2FoIC6XsWjbUo+h+D4o7yC3M8F/kIZS2Hu6JLKXK1YG/bKlysA1 pYpw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=sUCL94PZfXP1MwR6x13KWCVDB5awWyt94Bx2yEZZxlQ=; b=cblbRW86A2014iLd+s+8laHVAM4F91mywOiW4ODa7iwctVwieN+10lh8gkGKxkdfpq F+FSL+QoVndvtw0leNPUcjSiIe+W7vt/7wbWa7i3LjhlVQ+gAbmfUMOLJNg1PupoWlnu dnN78r66EP94K9cA15JK0JKAkweu03x2q7fB1EkjEVDIoUTpZS9scWWSXp+6InWw0DeB ptuy8At1S2+KkXlunkKmil08WddJJ0bSlNCYOYwCYH6c9bNE9iBkjc9Ug6gwoijNY3FK /NU11GM6WKhFfZIm2gRFlJzp/TkfbH9affAniR2asAqh9X6o4ZP+L0SlQGo25MMqzOBf 3/LA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="FQFBaVc/"; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id k17si1520700edk.3.2020.07.22.21.50.58; Wed, 22 Jul 2020 21:51:20 -0700 (PDT) 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=@gmail.com header.s=20161025 header.b="FQFBaVc/"; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726500AbgGWEs3 (ORCPT + 99 others); Thu, 23 Jul 2020 00:48:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43906 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725843AbgGWEs3 (ORCPT ); Thu, 23 Jul 2020 00:48:29 -0400 Received: from mail-oo1-xc41.google.com (mail-oo1-xc41.google.com [IPv6:2607:f8b0:4864:20::c41]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 14387C0619DC for ; Wed, 22 Jul 2020 21:48:29 -0700 (PDT) Received: by mail-oo1-xc41.google.com with SMTP id s190so865561ooa.13 for ; Wed, 22 Jul 2020 21:48:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=sUCL94PZfXP1MwR6x13KWCVDB5awWyt94Bx2yEZZxlQ=; b=FQFBaVc/XNqmBDVi93JCidz6GXUn1V4SB2tNHx/g3BasbtQ7CY6HhEthIDXNtYiZ50 L/9zfCtxST0F9zGJ5UBebq7+aNMR0D4cICaj4l2hYk+L3OdqVl0f+6wZIBloHreI0XdT nGqLJKQjTSXqZGuyp0RUfxMyDzVS8PblaUX3AnMQu1AMNip9wZORHCCyn3v0lyUeUdF6 VqDbJmpiwxscxNON4sqE5qTG4prbz81fKGeWs4LqR3NMVrfCpW9FP/r2cbq62CmHURBs TF7rJbpq/7E/nrvqIW2W136VVXTCbaUNrT45Np2PWZYd4AsCXe9C+hGCL+F2Z/8J6cat 6iEA== 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:content-transfer-encoding; bh=sUCL94PZfXP1MwR6x13KWCVDB5awWyt94Bx2yEZZxlQ=; b=BrDLHQkM+soczl1ZfH/GjVT+SqraYoBWHIy4aqDzKl50IGt3HGvZuEiERhRWnCQLZb kSRdqQTibHVHvahxmO47hRGZmOBKYtMQ2JPeqEfzn7rF5HQUOw0zFtdPKbFTUOSJsPpE Py/0/lwh3t50lqfiQJqEI5f2BaIkiVh/SLPUVkoKgvzNN33+FdC+breO8CYXC1vSIZK0 V5h9iO6qjhq2/pXPdroEpaghX79z/dZQZzAYLz+SrLPYt0fPDbG1aOeIgPv9iy8nyiJD 0sVhnD8GsDxELTsrPPY95NmsGxPhqYHFdEcGbDEzmKZjbTwml4McSW8sX5Jqg1BccFxr GBZA== X-Gm-Message-State: AOAM532tAwxjuDb6lmUSv/HXlZ74ic3b4PFQih6UFP+96PcCkrpRLnSZ SR02fUmgz1EeR6ArfYEfiaxqhl++9X9bQifq4Y0qkuPi X-Received: by 2002:a4a:d4d9:: with SMTP id r25mr2966102oos.51.1595479708532; Wed, 22 Jul 2020 21:48:28 -0700 (PDT) MIME-Version: 1.0 References: <1595250506-9769-1-git-send-email-qianjun.kernel@gmail.com> <87eep32zod.fsf@nanos.tec.linutronix.de> In-Reply-To: <87eep32zod.fsf@nanos.tec.linutronix.de> From: jun qian Date: Thu, 23 Jul 2020 12:48:17 +0800 Message-ID: Subject: Re: [RFC PATCH v2] Softirq:avoid large sched delay from the pending softirqs To: Thomas Gleixner Cc: peterz@infradead.org, will@kernel.org, luto@kernel.org, linux-kernel@vger.kernel.org, Uladzislau Rezki , Yafang Shao Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jul 23, 2020 at 2:05 AM Thomas Gleixner wrote: > > qianjun.kernel@gmail.com writes: > > + > > + end =3D ktime_get(); > > + delta =3D ktime_to_us(end - start); > > What's the point of this conversion? That's a division for no value > because you can simply define the maximum time in nanoseconds with the > same effect, i.e. > > ktime_t end =3D ktime_get() + MAX_SOFTIRQ_TIME_NS; > > if (need_resched() && ktime_get() > end) > break; > > So you can spare all that start, delta and conversion dance and keep the > code simple. > > Also notice that need_resched() wants to be evaluated first because > there is no point to do the more expensive time read if need_resched() > is false. good suggestion=EF=BC=8CThanks I will make changes in the next version > > Thanks, > > tglx