Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp2514875yba; Mon, 15 Apr 2019 13:19:22 -0700 (PDT) X-Google-Smtp-Source: APXvYqz/aF2LCVAeaZibl3ZdC4bHK+kHWO9eUHKs8t7N3wu1Z26jwlV/8nav8RqBO32cZN8lJZQu X-Received: by 2002:a62:1647:: with SMTP id 68mr15851311pfw.113.1555359562582; Mon, 15 Apr 2019 13:19:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1555359562; cv=none; d=google.com; s=arc-20160816; b=LHp1pkTVAjuG4BTqwIueVCspKkwV0TeLDDPUWBBf9aHADIqiKQr5XxUR5s7ayV1kYB J2LW5yQtj/dCWmfNEdUb0/73WpMjNwQlAxXIXZEeG7515So4V6/At2F0OJOmHKBIfsO6 r6hgox6BLcn/FnUWdRUFRThFxTQ2+BDwODfIgShDSDMb+DLGDgyRuKj4CFDgFqel61t5 wSNe88nCp9TU9to39DxyQ++qtmm8ANk3vpk8ZHB8bFcsRh73hDDmWK2z3aCiP3vNDIzJ qiTx2xIaUDihhXh+gA4yME+IbNM46AYz3b5SD1KwKxvULSjtdmlyjclt7duTWF9dsdKD HpiQ== 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=w4EBnL+0sBJU+Yv7IfS4TmVSXq4JvnIZY1It1IlO70M=; b=RfCn1pnjacqDZcuxu1MCA+I3uPe2i6+ydI05jgIUkcPLApDlIPh2MkdqJ5JbivNiaC buxdEViJjEmRQQLKlwGCfKhPMTp8GW+QzsKyKuFIta1hMhUt0H8ch0KKuocxXmNFK44X nQSbIzPCfRMMt7bbjj3eT4jhzXvxRBlD/HE1lRI8OAkiU4Khvdn1u3wX+JqhH7hk5ch5 7Sjze1oRwH2dwdLbz6Cj2+PezuH7hjr7uOajPjDC9p138A87AzP3wB+moe8bmOWzCT21 6VSkC3xOQls613066WiDzpTMwzVsITK2E1CISZRYVouInk6TyzZoMJAt/ubOdQQ6CQXy QGYA== 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 r15si45982690pgi.27.2019.04.15.13.19.06; Mon, 15 Apr 2019 13:19:22 -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 S1729048AbfDOURk (ORCPT + 99 others); Mon, 15 Apr 2019 16:17:40 -0400 Received: from mx1.redhat.com ([209.132.183.28]:56396 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728148AbfDOURj (ORCPT ); Mon, 15 Apr 2019 16:17:39 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 6206F308626F; Mon, 15 Apr 2019 20:17:39 +0000 (UTC) Received: from amt.cnet (ovpn-112-12.gru2.redhat.com [10.97.112.12]) by smtp.corp.redhat.com (Postfix) with ESMTP id 7BE805D9C9; Mon, 15 Apr 2019 20:17:34 +0000 (UTC) Received: from amt.cnet (localhost [127.0.0.1]) by amt.cnet (Postfix) with ESMTP id 893DE10518E; Mon, 15 Apr 2019 17:17:09 -0300 (BRT) Received: (from marcelo@localhost) by amt.cnet (8.14.7/8.14.7/Submit) id x3FKH9tA014287; Mon, 15 Apr 2019 17:17:09 -0300 Date: Mon, 15 Apr 2019 17:17:09 -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: <20190415201708.GA14212@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.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.49]); Mon, 15 Apr 2019 20:17:39 +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. Patch against v5.0.5-rt3 branch of linux-rt-devel.