Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp2015646yba; Sun, 5 May 2019 20:24:55 -0700 (PDT) X-Google-Smtp-Source: APXvYqxE6IYjGt6wxFLG8tyJ3Ot9NZGTAO2CsBK6HZ9Z3Ptz/0nqpCW4/Bwxsh8IXiUFDjZeyzii X-Received: by 2002:a63:4f1c:: with SMTP id d28mr28853052pgb.144.1557113095642; Sun, 05 May 2019 20:24:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557113095; cv=none; d=google.com; s=arc-20160816; b=vHRwcBIQvrvuIaFZP9ktr7M83qX+bNivO0SIUBDmpZ76GTqzF2GI7QPg8aJ0i0siX1 QG5Qqr4zpWfBYfScEkvsPCjfN6PBX+wqSpJDeLAZVl6ey1lbmQvz6lWz1HZnGEH2m/uA uGLA1dSTruIuWzuZPTU6czIlcLH99qKXabuHR094Ad+7VfPDhriT4v/37HkuPiQ/onOp k9kLBsDdnyyLJSSGy0W38kQASyhTVq/RQQ2NFzIksG0G/dlWpHiYVS9XWXNcPz0CWJ/f l0BMr0Nd9b32P5SgtRZHIkQtJO3Qjm1NZekfSqmj0j72EMmrorYKOx3ScuxK8jqtU4uF iBEA== 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; bh=/oKnd/tal23qmmdcIZQWyQGbLm8fcpiK/OvTlKycHNY=; b=ANIbvLppwtw3lh1M9MJL7sDbt9IHp8KQBff4ot1c6XIJID79+ereKoyA8cMxoeUXvz 8CUz9l4Y4q/lDTanGqYwHKdIgIL8uOjWjPp0Y/4yG0w+CQ6Il+VsaAoqk+b4cza+BqtG r+caL05Y1TjRoLFwV+FMXvwPuTWRrl89aZgy7bmNemiNcMtgOWK0VZa9yyuIuEJVCxzf rZ5oANh/ji6fJ0FkdyL5Qo9nO/dloV3yg7k1iOjlPB0bEMcuQzekgl24zPK9MMh2cZeH shkCjzIp7JsDv1G3mdBBs0YXolrqI2V3TTrLNFq4HHuDxsxRe6jK3bYio8Iq14L0nQIZ YEdA== ARC-Authentication-Results: i=1; mx.google.com; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t14si15039952pgs.543.2019.05.05.20.24.39; Sun, 05 May 2019 20:24:55 -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; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726156AbfEFDXu (ORCPT + 99 others); Sun, 5 May 2019 23:23:50 -0400 Received: from mx1.redhat.com ([209.132.183.28]:52520 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725813AbfEFDXu (ORCPT ); Sun, 5 May 2019 23:23:50 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id AD92383F40; Mon, 6 May 2019 03:23:49 +0000 (UTC) Received: from amt.cnet (ovpn-112-4.gru2.redhat.com [10.97.112.4]) by smtp.corp.redhat.com (Postfix) with ESMTP id 1F3505C70A; Mon, 6 May 2019 03:23:44 +0000 (UTC) Received: from amt.cnet (localhost [127.0.0.1]) by amt.cnet (Postfix) with ESMTP id 002BA105169; Mon, 6 May 2019 00:22:35 -0300 (BRT) Received: (from marcelo@localhost) by amt.cnet (8.14.7/8.14.7/Submit) id x463MY6B031434; Mon, 6 May 2019 00:22:34 -0300 Date: Mon, 6 May 2019 00:22:34 -0300 From: Marcelo Tosatti To: linux-kernel@vger.kernel.org, linux-rt-users@vger.kernel.org Cc: Thomas Gleixner , Anna-Maria Gleixner , Daniel Bristot de Oliveira , Luiz Capitulino , Haris Okanovic Subject: Re: [patch 0/3] do not raise timer softirq unconditionally (spinlockless version) Message-ID: <20190506032234.GA31395@amt.cnet> References: <20190415201213.600254019@amt.cnet> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190415201213.600254019@amt.cnet> User-Agent: Mutt/1.5.21 (2010-09-15) X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Mon, 06 May 2019 03:23:49 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Apr 15, 2019 at 05:12:13PM -0300, Marcelo Tosatti wrote: > For isolated CPUs, we'd like to skip awakening ktimersoftd > (the switch to and then back from ktimersoftd takes 10us in > virtualized environments, in addition to other OS overhead, > which exceeds telco requirements for packet forwarding for > 5G) from the sched tick. > > The patch "timers: do not raise softirq unconditionally" from Thomas > attempts to address that by checking, in the sched tick, whether its > necessary to raise the timer softirq. Unfortunately, it attempts to grab > the tvec base spinlock which generates the issue described in the patch > "Revert "timers: do not raise softirq unconditionally"". > > tvec_base->lock protects addition of timers to the wheel versus > timer interrupt execution. > > This patch does not grab the tvec base spinlock from irq context, > but rather performs a lockless access to base->pending_map. > > It handles the the race between timer addition and timer interrupt > execution by unconditionally (in case of isolated CPUs) raising the > timer softirq after making sure the updated bitmap is visible > on remote CPUs. > > This patchset reduces cyclictest latency from 25us to 14us > on my testbox. > > Ping?