From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wr1-f52.google.com (mail-wr1-f52.google.com [209.85.221.52]) (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 AF9033A75A3 for ; Tue, 7 Apr 2026 10:17:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.52 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775557033; cv=none; b=PGYIO65xA0P90RSSV0fgPlzlNHeYlSo30qDb0MC/YHP9/hXyq1NoWS9vkCbkKgw9xB2GdUDTqQ5NQABY02zYWgC97b/Qg+0blho4zG8drqZgNh4Biqul/GneJB8mkmbFipNltiCWqzLEQBWBbRHH46kVZVcO6U9H8kTdY3do/Q8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775557033; c=relaxed/simple; bh=ig2f6qxwE83Kdi8S7i0t2ZVgnHCNwxVyPDJHI2vpgkI=; h=Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=EV+925UHT2WvCVd5ZgcpyNGXC1g1LWUokEzZrGWNG+/huorl0dkP1P4XLUinduCwSiWF0nDneqnVByFIzbVpGtKZtjwJbEGX8zQBMwC2n4/08j8myxs5Adl7rfGPZ+cLdW6wxvnQAc9W1aeRsWaSq2yeJeipiLR6mU6YqTF+2EM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=sFKPlW/j; arc=none smtp.client-ip=209.85.221.52 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="sFKPlW/j" Received: by mail-wr1-f52.google.com with SMTP id ffacd0b85a97d-43cf73bbfbdso2913178f8f.1 for ; Tue, 07 Apr 2026 03:17:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1775557030; x=1776161830; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:from:to:cc:subject:date :message-id:reply-to; bh=VBFzEVqOi0j1kjVLWKG1vq/ezcl9Y9uNOk4ZaoSZHCM=; b=sFKPlW/jd3VDWRbzZCJSCOm/d8cjfzXyK6HT9SRvCX5Jd+KJFH0SKHPVFXKmAnOi5s H7bDL2yGBf7lthKiexC2fM2ediFivTYFse3M0Y5VgmDYIHD4oGBECGlZhiS0EumsAqVQ Pn6lr0ktWihb/5QYxymB4FNiXjtXNrTQrzZn7iQtMxbVDR3ww2Lt/Zt+NtDqZ1M6F9xq 7O/cQa+UJQIp1C93Siisf2+1PCf1cagS9unfJLKk3lk1H0qyka9Vh03PBKQglN0/kurs FuO1sdWGEZKV3W2ACKD15dwJPs9m9A+ld085EnZiunj/uANFYVqnsF0hZ6MdW6o3lxgK BwEQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1775557030; x=1776161830; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=VBFzEVqOi0j1kjVLWKG1vq/ezcl9Y9uNOk4ZaoSZHCM=; b=Z825Mt2THXLsZKdUNW5xu07rsBWVXXV6dyOTm/NB2C1uvGXeErGAtHHlk/06Qxaik5 kbn/WYZcga0SXsNkAPa98vto6JAIZBTDDXaHMbUjDhr+hZ9C13feVak11ThKJG+GCCPN +2x3zwBrLyoz5bsEb8RaVnvGdepIvb1IgUaAPivWyeOk8F2kMuvx+JX97r3EukOtdJwQ BqWS1NxhNVQYHOveuY+WWcegzShT4efGcfnv8QUlT7WOzfFqQ6DEaUVzc77Q9hUp6JBU lLVeyD+aClH8vIIEws4w+BpDV4yqSArkR6LOjUi0QeASmAiJhKkJpYensRRpK61L+RmT p3QQ== X-Forwarded-Encrypted: i=1; AJvYcCXtb+Cm/inBJL1mtZqbfSREdzg43Wm0r5scPIKn6R80kmyX0+K05Eumr+1ryqwF3nMOOgaXE2V3ut64P/0=@vger.kernel.org X-Gm-Message-State: AOJu0YyzV0snyTEwhSsSozVuvthrHF+dZdBXojY+rVcvGD7hcUGH6SG+ pUNJvNXJd/ZBKAoO5I1LuwCk4MPJY+UHmLNimfeLjWDNwkfclqImmHrx X-Gm-Gg: AeBDieuGdmo+btW6a8/aYdM+y0tzIYXLoW3GpKxPiso8VZ9TCrKcz6ecwD+UJqEATrH ntoayYyf2sMJkr5gOVJt5Oybgre0bMrlQJpKoWMy2+Yu+bT0Ggqnr9s9y3gtNcxM1igXzhsu0xZ Zb794/bu3L43TPdIfRAdGZgOR+LAah45r7zUsNbVfiFC0zcUQYdzxrDxnsgh7qGAsm8uv5ffS05 +hRON6kgSSNwPIhIC36orb3HDGo1SyZ0+Z8O1YJr3psdRPA66utCqPgpTtyKXlcZR3ovjruYtLW tOnLVP9Hse6asqtqSLnSff9zcVi7EROkkjNqlW6Anqra0BMG0LV8/EEotnS4tFCyTUMVtgN6zlB zDH1cMazFBi+VMH4uI6OpiLC9EGaAsK4l5lIcOE8vdcPkmkU5nghBWklONO3T14Tvy55j+SGpMB vQj9CFdWwP1tom8nh8YcrGHVPIVCMdMPetKp3PwThhJaaHMXTuJCJB2F3V0b2f4fnY X-Received: by 2002:adf:ec48:0:b0:43d:305f:c312 with SMTP id ffacd0b85a97d-43d305fc344mr13522620f8f.3.1775557029752; Tue, 07 Apr 2026 03:17:09 -0700 (PDT) Received: from pumpkin (82-69-66-36.dsl.in-addr.zen.co.uk. [82.69.66.36]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-43d1e2a6f5bsm44465072f8f.7.2026.04.07.03.17.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Apr 2026 03:17:09 -0700 (PDT) Date: Tue, 7 Apr 2026 11:17:07 +0100 From: David Laight To: Andres Freund Cc: Ritesh Harjani , Peter Zijlstra , Salvatore Dipietro , linux-kernel@vger.kernel.org, alisaidi@amazon.com, blakgeof@amazon.com, abuehaze@amazon.de, dipietro.salvatore@gmail.com, Thomas Gleixner , Valentin Schneider , Sebastian Andrzej Siewior , Mark Rutland Subject: Re: [PATCH 0/1] sched: Restore PREEMPT_NONE as default Message-ID: <20260407111707.4c4cb7dd@pumpkin> In-Reply-To: <4q4zsstjeef63sdkl2az3tziy3etorzzxyt2k4nhwokpmegsr3@y6w76kosjzts> References: <20260403191942.21410-1-dipiets@amazon.it> <20260403213207.GF2872@noisy.programming.kicks-ass.net> <1pgulz0k.ritesh.list@gmail.com> <4q4zsstjeef63sdkl2az3tziy3etorzzxyt2k4nhwokpmegsr3@y6w76kosjzts> X-Mailer: Claws Mail 4.1.1 (GTK 3.24.38; arm-unknown-linux-gnueabihf) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit On Sun, 5 Apr 2026 10:09:35 -0400 Andres Freund wrote: ... > FWIW, from what I can tell, the whole "WHAA, it's a userspace spinlock" part > has just about nothing to do with the problem. My understanding is that > default futexes don't transfer the lock waiter's scheduler slice to the lock > holder (there's no information about who the lock holder is unless it's a PI > futex), Postgres' spinlock have randomized exponential backoff and the amount > of spinning is adjusted over time, so you don't actually end up with spinlock > waiters preventing the lock owner from getting scheduled to a significant > degree. Another problem (which also affects futex) is that the lock holder can get preempted (or just stolen by network interrupts and softint code). So even if the lock is only held for a few instructions sometimes that can take several milliseconds. Pretty much the only way to avoid that is changing the code to be lockless. (eg changing linked lists to arrays and using atmomic_increment() on a index.) A much more subtle effect can also affect performance - especially of a single-threaded cpu-intensive program. The clock speed of the busy cpu will be boosted (perhaps to 5GHz). Then a lot of other higher priority processes are all scheduled at the same time, the cpu-intensive program is preempted. When the the high priority processes sleep (perhaps almost immediately) the cpu-intensive program is scheduled on a 'random' cpu that has been idle so runs at initially (say) 800MHz, before being boosted again. That effect increased the compile time for an fpga image from ~10 minutes to ~20 minutes when the renaming of a kernel config option caused one of the mitigations that significantly slow down system call entry/exit to slow down an idle daemon than woke threads every 10ms (to process RTP audio) so that all the threads were active at the same time. David > > Greetings, > > Andres Freund >