From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-dy1-f177.google.com (mail-dy1-f177.google.com [74.125.82.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3840823D281 for ; Tue, 2 Jun 2026 00:44:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=74.125.82.177 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780361062; cv=none; b=fYObL3GKjmTIC9zf8sR8+uAIg+f5jgSdD8X31G0G4JYGXo9OA5c01OxeSwRiYyDSfvpj/mg1CP3rJOfiOBsM+MjNftfSF7msQT1wiUcL+f7yspz9a//fHkMnMK38Y8vFRATfOVORa2RqpWZxRMDXWuF9JeOhAqQjjBj+etzB7S0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780361062; c=relaxed/simple; bh=xgJ7V0ENrBO7HnCYHHPTG2icvZb7IjbyLhkxgYZBUkU=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=uuqSG4splzcUCBVSY+hDQ0AouYqsgAfmHOge9+jpVg1YnVfNNb/L74FuorwFDkaC/zrvSz8yOUzjr7E216xEQyFnK4mBs/B0EmS0kx+ru0MH1sxHevWZUwVo9hofWBzRMVDmSWlDVaRq4MSaUT5AzKUY/J1z7qhEcJLJezhPg4o= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=wbinvd.org; spf=pass smtp.mailfrom=wbinvd.org; dkim=pass (2048-bit key) header.d=wbinvd.org header.i=@wbinvd.org header.b=GjGSYH2n; arc=none smtp.client-ip=74.125.82.177 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=wbinvd.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=wbinvd.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=wbinvd.org header.i=@wbinvd.org header.b="GjGSYH2n" Received: by mail-dy1-f177.google.com with SMTP id 5a478bee46e88-304fb780deaso3060630eec.1 for ; Mon, 01 Jun 2026 17:44:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wbinvd.org; s=wbinvd; t=1780361058; x=1780965858; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=YU4nTV8pXfPQduF2ie+x5BszKiRZNCF/8yTRq9PVrAA=; b=GjGSYH2n71FfLKcHylGvbQ0Kv+egBplaClbFvRaWeLHU6vLsvg2uKy46OnU+VePeY9 B603cFEKCpJJx+LkqyOoZZCdvWqt/QhiBVnVVJUU9ywvNS9Czo2R73Epj++HgXtVaFPk iR94FfI8nEjX7Pa33Am5R/pshRgNGhVGZjdR9isA05YeYQHoSlX1/zCm/ao9MM1EE6xR x9w/GqVNoen5VibHVvhFvsDj5oaSBvg1AkuHqIZhIppiIpjibNASzjWQGUpRmpeQC5/B pshPAkPmn4BnFq8scw9C3e1/yJHXBmmJybz9rCjiDLZ7s52Xp44rtkoSi4tUF9VGOvck sxLQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1780361058; x=1780965858; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=YU4nTV8pXfPQduF2ie+x5BszKiRZNCF/8yTRq9PVrAA=; b=hBI1ldW+KzoiLWo1RDJmOsFsXFMtiK7xtfrbkpudmFq+ZLBAFnYvD3fMMGCZ8EZQ63 1vbAo3yXPl8ba0tDu5uhmzDZxgFuxfH8XXKk4pfhFB9I0nUWp3OlFKgwd/eziBTTMrx9 lvW66Vf5J1/kxppXc2ytrzAMbIUmwMUxKQ9mT5wxCrAFwLmhZXrM02gPv/ibkjGQOODI 8+yfGN+DvKpgvQQexrGauM/aSDBRAtEfToDQs+NvJkJkXEvNICBi47bqHGtS+LDpv1O2 R3bRrcO8cg4NfZ6btycSMZv0z9nUMEPtsLZEHMTJX7dyIjjgE8u/RUpCYRcq57Y3CZdT vZAA== X-Gm-Message-State: AOJu0YzeMRJOle6iAVu/s2em0ODsOD6DONlxg/o7rJso5cR337803+cW g8Yjhsw1T5t/DimxUoPjg0p5DdM5rtUvTLfevLlu/ia3QgXKnvUTKr1S48b3c8EXEnhhuDaweEC xuoY0 X-Gm-Gg: Acq92OFtyXbWt677FYA+5Q7U7oL1u8g05KaxiYg5WOABszvT1MgN0DaEzbPXQPATNnp B3OH+wDQyyyh5DfRNANxL9J6xghgpyALTWNKmQmlrhrYYggxIC6JeFmT2LzPvzjFJNKC4kkMrgZ Sxtp0T1QxznJqdJvPoGP4gAPeD0FKS6VrUffJfYBZxCnpWvuUPvh/rvuR1sXWbZIR4AHFsdVtg7 oznF3h4RlKvL6++jGuzT7Gl+POFFlqNrOxGR5DLP/xYAyJHYpHYJg0o8OMkxr2tYULk3b/exZhF uwQWFqLYWfozmep5Sd1sbnf0u8DlN8lpAxQBbruUJrFaTEbYGp4dtL1oUmA+rIL/3G5YAofsVv7 JHBWpRM5Isyjh2yjFV54ifTHRsq0zv8ruBhjCvaCaj5Kpr6+/R4Mw+TfJKdlgzc5Q/89zc84rG9 6Hg9N3KQDK8QcJxitwCDkoHviG02ft3Muu00E1 X-Received: by 2002:a05:7301:1f06:b0:304:8881:b82 with SMTP id 5a478bee46e88-304fa4cf1fdmr6379022eec.1.1780361058228; Mon, 01 Jun 2026 17:44:18 -0700 (PDT) Received: from mozart.vkv.me ([2001:5a8:468b:d015:e55d:f6f2:1f67:2056]) by smtp.gmail.com with ESMTPSA id 5a478bee46e88-304ed2c10c1sm9892762eec.1.2026.06.01.17.44.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 01 Jun 2026 17:44:17 -0700 (PDT) From: Calvin Owens To: linux-kernel@vger.kernel.org Cc: linux-rt-devel@lists.linux.dev, Rodolfo Giometti , Sebastian Andrzej Siewior , Clark Williams , Steven Rostedt , Greg Kroah-Hartman , Eliav Farber , Michael Byczkowski , Ingo Molnar , David Laight , Thomas Gleixner Subject: [PATCH v7 0/1] pps: improve PREEMPT_RT performance Date: Mon, 1 Jun 2026 17:44:08 -0700 Message-ID: X-Mailer: git-send-email 2.47.3 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Hello all, I'm relaying v7 for Michael. A quick note, this conflicts with the patch I have out to remove capture_clear: it's trivial to resolve, but if it saves anybody time let me know and I can respin one or the other. Thanks, Calvin --- From: Michael Byczkowski Changes since v6: https://lore.kernel.org/lkml/cover.1779733602.git.calvin@wbinvd.org/ - patches 2 and 3 are dropped since neither lock is ever taken in hardirq context. Changes since v5: https://lore.kernel.org/lkml/719A31CE-CA58-45C3-A013-1BFE81F724C5@by-online.de/ - Reordered: the pps_kc_hardpps_lock conversion now precedes the pps_device.lock conversion. The previous order would have briefly produced a raw_spinlock holding a sleeping spinlock on PREEMPT_RT (Sebastian). - Patch 1/3: commit message reworded to describe the handler split structurally first, then its PREEMPT_RT benefit (Sebastian). - Patch 2/3: refactored pps_kc_bind() and pps_kc_remove() to use guard(raw_spinlock_irq) for scope-based lock release. Eliminates four duplicated unlock call sites in pps_kc_bind() and the ambiguous bracket structure that resulted from them (Sebastian). - Rodolfo's Acked-by on patch 2/3 is preserved from v5; the guard() refactor is purely stylistic and was suggested by Sebastian, but please re-ack or NAK if disagreement. Changes since v4: https://lore.kernel.org/lkml/B24484C5-3117-4C56-9522-1EE9876E64BA@by-online.de/ - Patch 2/3: added Acked-by: Rodolfo Giometti Changes since v3: https://lore.kernel.org/lkml/83318241-44C3-48BE-829D-5C5F82A78A74@by-online.de/ - Patch 2/3: fixed lost indentation on pps_kc_event() call (reported by Rodolfo Giometti ) Changes since v2: https://lore.kernel.org/lkml/1BB87C0C-33C1-45C3-B50E-C5F349DA3FDC@by-online.de/ - Patch 2/3: moved wake_up_interruptible_all() and kill_fasync() out of raw_spinlock section to avoid sleeping-in-atomic on PREEMPT_RT (reported by Nikolaus Buchwitz ) This patchset addresses three sources of PPS jitter under PREEMPT_RT, while being fully backward-compatible with non-RT kernels: 1. pps-gpio: The IRQ handler is force-threaded on PREEMPT_RT, so the PPS timestamp is captured after scheduling delay rather than at interrupt entry. Fix: split into a hardirq primary handler (captures timestamp only) and a threaded handler (processes the event). Tested on a Raspberry Pi 5 running 7.0.1 and 7.1-rc PREEMPT_RT kernels. On non-RT kernels there is zero behavioral change. Michael Byczkowski (1): pps: pps-gpio: split IRQ handler into hardirq timestamper + threaded handler drivers/pps/clients/pps-gpio.c | 37 +++++++++++++++++++++++----------- 1 file changed, 25 insertions(+), 12 deletions(-) -- 2.47.3