Received: by 2002:ab2:6816:0:b0:1f9:5764:f03e with SMTP id t22csp951235lqo; Fri, 17 May 2024 06:41:03 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXLsQwlIRHgrkwL8iIyPEQ9V0ssyfKA2YeSyx+AxRNSDeAVec9Bjv9tii4zynKJzHk4rSe6FdCGRdfWhEwHiN7DjigPckrFYyG4PZ8cBQ== X-Google-Smtp-Source: AGHT+IHLp1euV5Jx87Z1VDeSVE0LOfyDTEDlQmFa/zLBfqN35zOKag2fy73WoS1yVhcnJ2FCsiDH X-Received: by 2002:a05:6358:5694:b0:18d:b8bf:dff with SMTP id e5c5f4694b2df-193baed816cmr2204784055d.0.1715953262806; Fri, 17 May 2024 06:41:02 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715953262; cv=pass; d=google.com; s=arc-20160816; b=suB36mjvanszuTAHuPpttJteCHcS4WwTk1RU2bhs9ED7Z+hkckFt8YKRbeuPMWzhGS Nyz6APpsYgv7JNTWZgnkpXbK9xD4uFhRrRcXSZmApiEurP+9ATuGQPSCuvmojGbE9i3W UMaX4sqPkeVrTOFD1FK9IQCauuCUw98tpNvR+VWsOM9bBswSKpdEnzrU9wXPdXOeJeRD hdAJ/tk9Pt2u31gltxOArJKAHE1nkHl6v9wZVTp+iSB57nFBFa40hFW6QahNlFU3QW2j xWsygugyCBlMHIO475M8t5/zCNUZqRBmwQrl04aIjnSFfge/Khj4AOzhzymg/aoOxurj plxg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from:dkim-signature:dkim-signature; bh=zG4qeZ4wXm0hhUEol81eqqpjCLMzzmjIMFnN0YK47ls=; fh=TxOZSmENUlZgu5z+MAtXGShgG9Ya2wtg1cm2MlPPLEs=; b=ydVGRdq1bXhri6DkbagVevWuPuh3zhVtKT9/S8wybC3HGSBzkE0/4tuGpV4ByxmgKc T+Ox/nzCQHIMkxtmsQXSUmNzp1+GRNA+KRqWoUIa3EbEohvBvW5dNLCVJQZPQ7In1scp 0aoeKUYqJjzU1xNzazwxkKjLaL9DA2cbSgXL9Wzwo6MIHJMGzYAyk4vGfSsGT2pvpEZi 4G5JGtJfGioGo5uT1DRRTRGhlWpAGXt2StLnN8c86tl1pSxIrW8iLtQwLjpiqAj1jgUr jf6x3KGE3OpQ5yAmu40KZdJVdtk0MRr20Dz1nDfCKZ2Gm7a3edOoi9rEROAXbmZ3GYlc kFMg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b=IQGRpVxi; dkim=pass header.i=@suse.com header.s=susede1 header.b=IQGRpVxi; arc=pass (i=1 spf=pass spfdomain=suse.com dkim=pass dkdomain=suse.com dkim=pass dkdomain=suse.com dmarc=pass fromdomain=suse.com); spf=pass (google.com: domain of linux-kernel+bounces-182151-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-182151-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=suse.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id 41be03b00d2f7-6341190435csi17567510a12.595.2024.05.17.06.41.02 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 May 2024 06:41:02 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-182151-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b=IQGRpVxi; dkim=pass header.i=@suse.com header.s=susede1 header.b=IQGRpVxi; arc=pass (i=1 spf=pass spfdomain=suse.com dkim=pass dkdomain=suse.com dkim=pass dkdomain=suse.com dmarc=pass fromdomain=suse.com); spf=pass (google.com: domain of linux-kernel+bounces-182151-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-182151-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=suse.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id B72AB28207C for ; Fri, 17 May 2024 13:41:01 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B481B55774; Fri, 17 May 2024 13:40:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=suse.com header.i=@suse.com header.b="IQGRpVxi"; dkim=pass (1024-bit key) header.d=suse.com header.i=@suse.com header.b="IQGRpVxi" Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.223.130]) (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 27AD55812F; Fri, 17 May 2024 13:40:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=195.135.223.130 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715953231; cv=none; b=aBbGNbehIOLUWUC1WA6CPW7FIVm+DC7Th9hNo5cArtV6p7BiuiBiI/Z9k72zISP1atgCfIhnmCnwAMeZuQ3ZOnPbCzSJAe/yDRr0BsB7iSJzLxQ8e2555B4y2qh4P4kSOTjaBAaPndD2uWEuVFID0Ni4D0vZhIp/9NverhUbYAM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715953231; c=relaxed/simple; bh=dWndnL2fcmjN6OLz/k5yycYyXhbbDCUqxD4dhl9EUxs=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=Lwp/USBC5kTmB0hz1FJt/4Rot7/inTV2oeZK+UDdbqyq0uIU9hkFuTJwU6HiB+fJP6tN7JfEiR+H4Y9MQd/Y3xtCuNxlmEckmuNdqtAuG8Ovuhb79jB3/dm4NgDjad5EC4dzO2Ha/ypF/RchYVTdzYcul9F3UrSbZD+U1c1ZIv0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com; spf=pass smtp.mailfrom=suse.com; dkim=pass (1024-bit key) header.d=suse.com header.i=@suse.com header.b=IQGRpVxi; dkim=pass (1024-bit key) header.d=suse.com header.i=@suse.com header.b=IQGRpVxi; arc=none smtp.client-ip=195.135.223.130 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.com Received: from imap1.dmz-prg2.suse.org (unknown [10.150.64.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 576C0374EA; Fri, 17 May 2024 13:40:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1715953228; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=zG4qeZ4wXm0hhUEol81eqqpjCLMzzmjIMFnN0YK47ls=; b=IQGRpVxiYr0SkqYdxRblxdnj1xMPd93+UG2TUL9pn0rGGgz1YmI4amlpiNeNuSbcyLNF1S n4bHvAcsn9liD8wTtgSgG0D26yM2FS6uTbzIgCrWF05wDhqzMf88V6FkDkLGfeXf+bHsI+ jzNv4byDymOe0/lxskzpva46epP9I9A= Authentication-Results: smtp-out1.suse.de; none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1715953228; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=zG4qeZ4wXm0hhUEol81eqqpjCLMzzmjIMFnN0YK47ls=; b=IQGRpVxiYr0SkqYdxRblxdnj1xMPd93+UG2TUL9pn0rGGgz1YmI4amlpiNeNuSbcyLNF1S n4bHvAcsn9liD8wTtgSgG0D26yM2FS6uTbzIgCrWF05wDhqzMf88V6FkDkLGfeXf+bHsI+ jzNv4byDymOe0/lxskzpva46epP9I9A= Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id 3F23413991; Fri, 17 May 2024 13:40:28 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id 55PrDkxeR2Z/BQAAD6G6ig (envelope-from ); Fri, 17 May 2024 13:40:28 +0000 From: Petr Pavlu To: Steven Rostedt , Masami Hiramatsu , Mathieu Desnoyers Cc: linux-trace-kernel@vger.kernel.org, linux-kernel@vger.kernel.org, Petr Pavlu Subject: [PATCH 0/2] ring-buffer: Fix a race between readers and resize checks Date: Fri, 17 May 2024 15:40:06 +0200 Message-Id: <20240517134008.24529-1-petr.pavlu@suse.com> X-Mailer: git-send-email 2.35.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 X-Spam-Flag: NO X-Spam-Score: -0.17 X-Spam-Level: X-Spamd-Result: default: False [-0.17 / 50.00]; NEURAL_HAM_LONG(-1.00)[-1.000]; MID_CONTAINS_FROM(1.00)[]; R_MISSING_CHARSET(0.50)[]; BAYES_HAM(-0.37)[77.01%]; NEURAL_HAM_SHORT(-0.20)[-1.000]; MIME_GOOD(-0.10)[text/plain]; MIME_TRACE(0.00)[0:+]; TO_DN_SOME(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; ARC_NA(0.00)[]; DKIM_SIGNED(0.00)[suse.com:s=susede1]; FUZZY_BLOCKED(0.00)[rspamd.com]; FROM_EQ_ENVFROM(0.00)[]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_FIVE(0.00)[6]; RCVD_COUNT_TWO(0.00)[2]; TO_MATCH_ENVRCPT_ALL(0.00)[]; DBL_BLOCKED_OPENRESOLVER(0.00)[imap1.dmz-prg2.suse.org:helo]; RCVD_TLS_ALL(0.00)[] Fix a race between a reader swapping a new reader page into the ring-buffer from rb_get_reader_page() and the rb_check_pages() check invoked at the end of the resize operation in ring_buffer_resize(). Note that a similar problem with rb_check_pages() being executed with concurrent readers looks to exist for ring_buffer_subbuf_order_set() too. I plan to tackle it in a separate series. Petr Pavlu (2): ring-buffer: Correct stale comments related to non-consuming readers ring-buffer: Fix a race between readers and resize checks kernel/trace/ring_buffer.c | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) base-commit: ea5f6ad9ad9645733b72ab53a98e719b460d36a6 -- 2.35.3