From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pl1-f201.google.com (mail-pl1-f201.google.com [209.85.214.201]) (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 8C76A2F6596 for ; Sat, 30 May 2026 00:54:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780102455; cv=none; b=i4csQjFkHa+OSFPgEp3jDbmdI/3AKPWDTRw9+fZqxFgraDioWFjGJ8BjI4lXknOoT9kHQ50ccjqesAMM2n7HhY8TCehZrnb1o/RCC3IkHA0A97TmsV7pHB7cjBUxrAlO/E2enZjqksMudnCErhN4smLNKt/7UVADGKvMP9ets88= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780102455; c=relaxed/simple; bh=Uyf2v9i5Bgh3K6vN/tQBOUzmr7rOxXaZN1R07Nkp9KE=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=PJKc/lWgh4nvolZYEFc62ouVBNc2yfxfvhTCiKvnbmdzxndm/++TzITIowO3FASxxNgeKBi14nbcyKqUFKeElgENr4SWUhtrWWlrc4rlIuNFJSAexQ2eGMO2soAPz4vI4x6T4sqLDVSY9C2DTOKG+4CR/9gaitG4zMnYCP6Aqrk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--seanjc.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=bbfTSDY7; arc=none smtp.client-ip=209.85.214.201 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--seanjc.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="bbfTSDY7" Received: by mail-pl1-f201.google.com with SMTP id d9443c01a7336-2bd5b20aaa6so153658565ad.2 for ; Fri, 29 May 2026 17:54:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20251104; t=1780102452; x=1780707252; darn=vger.kernel.org; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=EimLeomyuHa/Isl8CJDHQMGSGuAmKMQVOAnH/aluLug=; b=bbfTSDY77ZsqjV5p6yeqTVOcMsKMM4zAkPnYbXE4efH35y+48iZ1p61TQ9IadUFafa 89+PmQeN4DglVo1cEATRG2i78gzxRDs05czqJJyJY3LO9mCpep1VCdzZoazKenK+GV+F bfk7UV6Ywy5h2R8DsLrjePNuUL/Ofw/ZWOI9VEPk90Fnn+T6t9SMo11GG8obAPq5k89Q 4iUNF2wecF98a1iMHJOJHaLALwev81XMSzVWigMsoi0v9J9mL8sgu/+6AgtOyDMBZHAq HgzElFfAP5G1j+Hj26YpPDOxT16D+hc/85pBKPHN/nH1evflZgaI0G0tQlU03GDIfnjL 2hvw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1780102452; x=1780707252; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=EimLeomyuHa/Isl8CJDHQMGSGuAmKMQVOAnH/aluLug=; b=nzFFx7+llegiQQfkCyiPOCoPRy1UKahQSDCVf7PPGY0Yal56z6GBM+xayOX5Aa2Zxj BPJM5cpw622y/eVK2VQssRhXFzIyBI1PTAuFLGCOWGRprYqATYCy/ZHINdpFvCY38WFy 7rQjxZ2hWSwYoO+nmJPGTBICltsLGFFv2xLIiH7xZsqI1Mn78BUmyuxuWM2F9bAFphQt tObdVXCv6IpOYsSiCz1pqSM3BkZc8kuQ5oAsOIZfSad46mw5/RDkb3X5D7CMSbo+kROR XvvrWtLH7r7UalshLj/NU2+kqO77erzuxY6Hb3GGv7q28P8tKlGj6Iw9OGLrmEZzBSKY nZGw== X-Forwarded-Encrypted: i=1; AFNElJ9uKkXswM9IofKrco/vX0nTXMSjcDSZpRtj0zHp8VpAF7glCK20YYkG7TCh49oDA86vZqm7pcOfGcrsYhk=@vger.kernel.org X-Gm-Message-State: AOJu0YzVu8y5Bg+Fx5BwA8T8pMRuOYe9n+ejhAJXLRuAiwfS9bjgIFSe P/HXY+OJv6WwzWTk3NLUpJ87bgTEupUIbYT43OFKxk6kheW72A4c48m9zNFAjwsiEIFrpKO6o0G j7rn+Bg== X-Received: from ploo20.prod.google.com ([2002:a17:902:e014:b0:2ba:41dd:4a8e]) (user=seanjc job=prod-delivery.src-stubby-dispatcher) by 2002:a17:902:f651:b0:2b2:5314:e96a with SMTP id d9443c01a7336-2bf3688ab6dmr23721265ad.34.1780102452411; Fri, 29 May 2026 17:54:12 -0700 (PDT) Date: Fri, 29 May 2026 17:54:11 -0700 In-Reply-To: <20260529203841.GC3568911@noisy.programming.kicks-ass.net> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20260529165114.748639-1-seanjc@google.com> <20260529165114.748639-2-seanjc@google.com> <20260529193214.GN3493090@noisy.programming.kicks-ass.net> <20260529193437.GB3568911@noisy.programming.kicks-ass.net> <20260529201335.GP3493090@noisy.programming.kicks-ass.net> <20260529203841.GC3568911@noisy.programming.kicks-ass.net> Message-ID: Subject: Re: [PATCH v2 01/20] locking/rt: Use raw_spin_lock_irqsave() in __rwbase_read_unlock() From: Sean Christopherson To: Peter Zijlstra Cc: Paolo Bonzini , David Woodhouse , Paul Durrant , Ingo Molnar , Will Deacon , Boqun Feng , Waiman Long , kvm@vger.kernel.org, linux-kernel@vger.kernel.org, David Woodhouse , Sebastian Andrzej Siewior , syzbot+208f7f3e5f59c11aeb90@syzkaller.appspotmail.com, Carsten Stollmaier Content-Type: text/plain; charset="us-ascii" On Fri, May 29, 2026, Peter Zijlstra wrote: > On Fri, May 29, 2026 at 10:13:35PM +0200, Peter Zijlstra wrote: > > > It is somewhat possible to do an RT aware read-write spinlock thing, but > > it is definitely non-trivial and this would be the only user. > > Furthermore, it is fundamentally one of the worst possible lock types. > > It really isn't something you *want* to have -- arguably even for !RT. > > They scale like ass; per them being a spinlock type, the critical > sections must be short, but this means there is nothing to amortize the > cost of bouncing the shared lock around -- which is the 'saving' grace > of the rwsem. > > For short sections the cost of the shared access will dominate. I'm sure > Paul has a bunch of graphs to illustrate this point :-) Hrm. We might be able to do an SRCU-based implementation. Full RCU would be too unpredictable on the update side. The big hiccup is when KVM needs to reclaim memory in response to mmu_notifier events from the OOM killer, which don't allow sleeping. I'll stare at this a bit next week. I'm not exactly thrilled about the idea of ripping apart this code, but there's a known performance bottleneck with mmu_notifier events, maybe we can kill two birds with one stone. Thanks for the input!