Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp2514437yba; Mon, 15 Apr 2019 13:18:41 -0700 (PDT) X-Google-Smtp-Source: APXvYqx288DWHEkoyc0ywD4XAbnMcNEQHxTgi7Uo2/JgznDuEZjLj3RTLBrjiXEHKsvtpoU1HFF1 X-Received: by 2002:a17:902:8345:: with SMTP id z5mr77809549pln.197.1555359521565; Mon, 15 Apr 2019 13:18:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1555359521; cv=none; d=google.com; s=arc-20160816; b=WzPJ27q+COpDMbLdioaTOc1q5yGQv+q5kOsuElvkZROIWvHbz5irsZNv51ib+hPIN+ i2dNRnISe9Ar9Ra5/AD+DlAZgdqqzskC9/7R1Wi0Cs8wCPgXZTVBaUcUju1/o/kGvBG1 c9URna+uOyY+bHjU9yRrE26Sh/M+WxqOD41NoSzek87Qm2uhYWV98PrskpnLHBFEd9fy jIVEbBV6pMbt/GYbZedSL422tDcOn/DptvF0H214mlhlMJSr+Cm10rYTgjDkuNJlipkB PwGLcW8t591BtwYSY0E4CzzrnYk3UIQfSx2oo/u70kWmOJBgWvTY0/SdJvNUtCeq6wV0 jgVw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:subject:cc:to:from:date:user-agent :message-id; bh=WwZTVuKuJlUXqruoKOHe7k/agQRwuE8YIWqFtQzRB24=; b=EddIc+E5DHsrRTRV/BWXJAaV8sTgYrNUDVUo52skL4e+OA94so6SJqv+819bQWhbZP ZFzXz+5dU2mr0sIBPC60tMsCsyRLDERHT/244kj0DEd2o6nryXzdHR2w14K6FawiygH/ dZGZ3KinmlqfYE7OvgDnTORRnNvluoIuQ401NDX1fFtRG/gf0UEFSuxIGUVjI1kYgZLn 04fgu8MpiRarIg5qXX6w5i/+qkFV+PoN03Dg4OS/lLN+TQ7mWZ8iJVITex2Z6dm8CeLz MEmSFisrfUWBo/vXJl3PF5x73pGLvVRzOXbf53VFHfCPG5rlO9IL/QLk4kI/061/ZRZi /INg== 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 k75si45631033pgc.515.2019.04.15.13.18.25; Mon, 15 Apr 2019 13:18:41 -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 S1728905AbfDOUQD (ORCPT + 99 others); Mon, 15 Apr 2019 16:16:03 -0400 Received: from mx1.redhat.com ([209.132.183.28]:52850 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728237AbfDOUQD (ORCPT ); Mon, 15 Apr 2019 16:16:03 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 68C6559441; Mon, 15 Apr 2019 20:16:03 +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 BC0A85D710; Mon, 15 Apr 2019 20:15:58 +0000 (UTC) Received: from amt.cnet (localhost [127.0.0.1]) by amt.cnet (Postfix) with ESMTP id 1BE5E10513E; Mon, 15 Apr 2019 17:15:38 -0300 (BRT) Received: (from marcelo@localhost) by amt.cnet (8.14.7/8.14.7/Submit) id x3FKFZmb013899; Mon, 15 Apr 2019 17:15:35 -0300 Message-Id: <20190415201213.600254019@amt.cnet> User-Agent: quilt/0.60-1 Date: Mon, 15 Apr 2019 17:12:13 -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: [patch 0/3] do not raise timer softirq unconditionally (spinlockless version) X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Mon, 15 Apr 2019 20:16:03 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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.