Received: by 2002:ac0:aa62:0:0:0:0:0 with SMTP id w31-v6csp1975074ima; Mon, 22 Oct 2018 01:50:35 -0700 (PDT) X-Google-Smtp-Source: ACcGV60Pc9cIAGw66coy3tD51IpIYAyDb6C67FS+gLCxR9VlBut9kTl+5Mu7vai4e3t+0RYM5IkA X-Received: by 2002:a17:902:8309:: with SMTP id bd9-v6mr14841972plb.161.1540198235034; Mon, 22 Oct 2018 01:50:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1540198235; cv=none; d=google.com; s=arc-20160816; b=WoTzUuRHtfP0U/84B6IauIk7I1c8qDK1cxOT0VCpOfOafOZEzJDFHWGycQ21iGALGK w/aDLWfSpi8RIMBFsPvyeEnsF0s2VBuRrnbq0w5XBXva1bEr22OQSFddBV8wb0HT7S+5 GeGVTO6BaRunhac8ZyGqUsyKz68pQ7N5T4Hw/S06sb7lGZ1+2LiILoXBHBrHaPpeAjD7 34Fm0iOe+bckfQMCWjQySV+pn/u0GKIb9w8jHOZTUbPF/ZmeVCOZavnxj+3xdU+GqIzr hag3yvw4ISODpXB+Hn6Yt2h7jaKC3/3u+XZVlTYLrjNoTcqxActOyNNmwRTfZkEwE+Vp 8Xpg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dmarc-filter:dkim-signature:dkim-signature; bh=Y8S1ZhyYdHAOdngUfz+wZ/JT5zlYGv1OGYEXZ1+QUj8=; b=b61hHDiuXWjLZey95hXca55Bytz9wVH+3g5pOxdsmy69pXMI/9+7DFGwPnryKMaeeE 2VshiSOdIDR9ACHiEP1PoaWsK1H/IPPbpWi3ncf/bZZVxRKlKr17GTfhLVoUJpw4QjoD fRDtyUG+1kqE8Yo/Out9XHoPdkfabD/nGRRnZWZkHC/6c5Otpwh2O0AXFjQomosWy6+A LuEgOTpssbMGwG3viM8ya+oRWKviUuHWsTevMEIeW8khKbBVai5+DYBrdMhpFfKQnIsN f+YjtG52Sd+7iz9GqWrjLPeukDetFstZdK5St6vCOw51C/gmY6qLYYJdf2fN0r4PGXJH Gd1A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@codeaurora.org header.s=default header.b=mzNwJCqd; dkim=pass header.i=@codeaurora.org header.s=default header.b=VUao7bMi; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u10-v6si31213136pgr.403.2018.10.22.01.50.04; Mon, 22 Oct 2018 01:50:34 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@codeaurora.org header.s=default header.b=mzNwJCqd; dkim=pass header.i=@codeaurora.org header.s=default header.b=VUao7bMi; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727826AbeJVQ3i (ORCPT + 99 others); Mon, 22 Oct 2018 12:29:38 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:43360 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727634AbeJVQ3h (ORCPT ); Mon, 22 Oct 2018 12:29:37 -0400 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 2001F6079C; Mon, 22 Oct 2018 08:12:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1540195929; bh=X0sOQCQB1Fln9Y0FF3k39QbT/jgVQSlmXRzck4TMMJc=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=mzNwJCqdEB9N4z/k0A6mTA4Z1Xx9qViA7XgJgZbR6/JzjhsHtuVJrljrYbEhBM6CB cxVKm6iRIu7jRmf+9M3I1zqxNYnzn1NN+6Ir/9+hawacsTv9xfarK2JMJEmYoKkel0 n1Dd+aNXC3BKmlHG1EJ3oi0brYIlZK3uRS8owgfE= X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on pdx-caf-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.7 required=2.0 tests=ALL_TRUSTED,BAYES_00, DKIM_INVALID,DKIM_SIGNED autolearn=no autolearn_force=no version=3.4.0 Received: from codeaurora.org (blr-c-bdr-fw-01_globalnat_allzones-outside.qualcomm.com [103.229.19.19]) (using TLSv1.2 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) (Authenticated sender: pkondeti@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id 34FDC6050D; Mon, 22 Oct 2018 08:12:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1540195928; bh=X0sOQCQB1Fln9Y0FF3k39QbT/jgVQSlmXRzck4TMMJc=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=VUao7bMiGonGBjEKY9NirUGV1cJIVZNXLtkR0sDAZcwRt3LnF3DPe1Y42xZNCR88a qtILSGBKVSaeyf+qBe8sWBp2cYtjzFHGNWbvALKyjjfSUFI78O2Cdg0hKxXzndLjIX qibOV33/Z1YLZRISHB4enKoYka9tFUEPxh2k/84Q= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 34FDC6050D Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=none smtp.mailfrom=pkondeti@codeaurora.org Date: Mon, 22 Oct 2018 13:42:00 +0530 From: Pavan Kondeti To: Frederic Weisbecker Cc: LKML , Frederic Weisbecker , Sebastian Andrzej Siewior , Peter Zijlstra , "David S . Miller" , Linus Torvalds , Thomas Gleixner , "Paul E . McKenney" , Ingo Molnar , Mauro Carvalho Chehab Subject: Re: [RFC PATCH 29/30] softirq: Make softirq processing softinterruptible Message-ID: <20181022081200.GB27587@codeaurora.org> References: <1539213137-13953-1-git-send-email-frederic@kernel.org> <1539213137-13953-30-git-send-email-frederic@kernel.org> <20181016041552.GA27587@codeaurora.org> <20181017002601.GB12996@lenoir> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20181017002601.GB12996@lenoir> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Frederic, On Wed, Oct 17, 2018 at 02:26:02AM +0200, Frederic Weisbecker wrote: > Hi Pavan, > > On Tue, Oct 16, 2018 at 09:45:52AM +0530, Pavan Kondeti wrote: > > Hi Frederic, > > > > On Thu, Oct 11, 2018 at 01:12:16AM +0200, Frederic Weisbecker wrote: > > > From: Frederic Weisbecker > > > > > > Make do_softirq() re-entrant and allow a vector, being either processed > > > or disabled, to be interrupted by another vector. This way a vector > > > won't be able to monopolize the CPU for a long while at the expense of > > > the others that may rely on some predictable latency, especially on > > > softirq disabled sections that used to disable all vectors. > > > > > I understand that a long running softirq can be preempted/interrupted by > > other softirqs which is not possible today. I have few questions on your > > patches. > > > > (1) When softirq processing is pushed to ksoftirqd, then the long running > > softirq can still block other softirqs (not in SOFTIRQ_NOW_MASK) for a while. > > correct? > > No, Ksoftirqd is treated the same as IRQ tail processing here: a vector can > interrupt another. So for example, a NET_RX softirq running in Ksoftirqd can > be interrupted by a TIMER softirq running in hardirq tail. > When ksoftirqd is running, we are only allowing softirqs in SOFTIRQ_NOW_MASK to run after serving an interrupt. So I don't see how TIMER which is not in SOFTIRQ_NOW_MASK can interrupt a NET_RX softirq running in ksoftirqd context. > > > > (2) When softirqs processing happens asynchronously, a particular softirq > > like TASKLET can keep interrupting an already running softirq like TIMER/NET_RX, > > correct? In worse case scenario, a long running softirq like NET_RX interrupt > > a TIMER softirq. But I guess this is something expected with this. i.e > > each softirq is independent and whichever comes recent gets to interrupt the > > previously running softirqs. > > Exactly, and that's inherent with interrupts in general. The only way to work > around that is to thread each vector independantly but that's a whole different > dimension :-) > Right. Assigning a thread for each vector also may not solve this problem because preemption would be disabled while a softirq vector is running in its own thread. I guess there is no hard priorities among softirq vectors. Earlier it was like first come first serve, now it is not. If we had priorities defined, (don't know how :-)) we could disable the lower prio vectors while a higher prio vector is being handled. This way we could gaurantee that TIMER softirq or HI-TASKLET won't be starved while a long running softirq like NET_RX/NET_TX/RCU is running. Thanks, Pavan -- Qualcomm India Private Limited, on behalf of Qualcomm Innovation Center, Inc. Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project.