From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-ej1-f42.google.com (mail-ej1-f42.google.com [209.85.218.42]) (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 5A5D24756BB for ; Fri, 7 Aug 2026 15:45:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.42 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786117532; cv=none; b=INrFAZxwYh13lLu6kcV1ECn79I4kmrJDDAC+IY4Y3UiTZ4Fu0qENliUyPONT8TdV93BKnnEsmP4+i8MsX6W5POM/T1cgWhHJPCV7TPlB51V2OMbRTO/11RLIemR22qMhb6nH0hDUyb5yU6T3hYNMNPHYZYFr0NqYpecaDXj2//I= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786117532; c=relaxed/simple; bh=Ek3pTZqQvm7qk435X2ebWHZF1j4UDu6RIlWcOQUp8gs=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=JRcLrxAcSvoolBYadh9SHrPkRo3NM5o/bagv+t1FeD27UZTT67iV2cci/Ov6fSh2x94dGfYCF9Yv4fsRFWG9OWqB9o6YxAEHuRi7T6RuUP820NhYrTmpJO7I/ypu924HhCIBLxVzKEjbDMOzbHcrMM9e23ZLvoORl2s6tq1mnpI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=QCNF/iRQ; arc=none smtp.client-ip=209.85.218.42 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=google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="QCNF/iRQ" Received: by mail-ej1-f42.google.com with SMTP id a640c23a62f3a-c1fbe461f59so512488066b.2 for ; Fri, 07 Aug 2026 08:45:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20251104; t=1786117529; x=1786722329; darn=vger.kernel.org; h=in-reply-to:content-disposition:content-type:mime-version :references:message-id:subject:cc:to:from:date:from:to:cc:subject :date:message-id:reply-to:content-type; bh=aHCw92KXAlA4YbfTRDT8QawrMa/113X+G0Ur1NsGMR8=; b=QCNF/iRQmTp7E5vDGvCflaU/RkDNaZBYsYqP56yR12XGqYw0UBiF/3pqDCIwSbhfJV gCZWQikzRVyLNEldRNszwdEHFGBsH72/QR1LbA/ynWbX3+gxBaAxL/GtbC0toYA8Q+Q+ W10uDSVCdNf1wie9yqeq0PqQuXf4QkTVFfsfJOhnuuA0asZWWBoDtlJTsJyu9uyzSV3X DroQkgEXQiayeGh4QuRfrsDvXYWUliBVZ4ZokloL/qK6Kd0SUwDf02qA4vgk7OXT5YSX KAuLLGUq/bpvyZDjDuKgT/9b+2Bml4mQziVSyRyPOeWbVS5XTtBXDcmmgmXhFaoNBW6d v1bw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1786117529; x=1786722329; h=in-reply-to:content-disposition:content-type:mime-version :references:message-id:subject:cc:to:from:date:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=aHCw92KXAlA4YbfTRDT8QawrMa/113X+G0Ur1NsGMR8=; b=Ns3PuUoUvYD+S+kWVnYITMT+zR0isxo1M7Z/akS95UyzD+qfB4OoKoTCVdOoyLHrIr 5U/lnI6KH5f8uELEj2QyI1yGIMfz+iuLKsSypC/SwE13SDgkeFKAFX81ThACmLZSJzeJ pVWdN2DAuP6J7lQGdOG+CT+XbhCj9Ld26WID2trBUqHFBhXGxEi9kDl4NiQAmUZ8k4CQ CVMZWPFPqIkXJD86dinLYwv/QZiW0a1mm2+xm17NicrPTkg31OIlMqmsBRFn6Ek/3qMK wvR1i07Qu0lJ1MzwZheGCjpAVTdD3yh0KqyfbCCeAFcZniP2zeb57GcmS95IQX2sq7tJ rU2w== X-Forwarded-Encrypted: i=1; AHgh+Rohmo9OQT3Cl1nteuQ5ySldLztzlf9CBoNZTVdVpwQSsrhV4Np0gINoRNTYZG5d6eCygqRfqLF37syy4Eg=@vger.kernel.org X-Gm-Message-State: AOJu0Yzo2wAYN8ApDd01aTKeilBnC5QO8tknKcxfe2mPZ50I36XaEDvu d2Wh3N5T3vVm5Yga5oNuPvUndqzeksPsMksA/KlbuT23hF1J9B+Lga1OI+R1ZxuaTg== X-Gm-Gg: AR+sD13dqNhq1Jk8qEgfSMixWbSZD35LAW+V2inpvHTJ01h0dxb0EYkxG755S9JyP/t phPHbRh30RZjNwE44eQhkIimJkhmjTX0Q37r3euEwTIL0T4leL+kUi9oB/CYnjEc5ILUqQKUtVF Dti+U/WoOZ3Mn81CK1UR8j/uI88krF5xdhO1ql+ZMkpyv0VFgN+lqd1qyKG3/Gi0OdBfcaGCMS+ NJK2LpNyYLk39GAO2iJ9PnJloMMKvQROraGQDVEV0IDOA9sF3MT0JMxCz7EWxR0TidRFYfYf9ff 2GDs6vkoVEzwt3H3mtv/hjzjZqM8NLY+W/Hfy67D3clLykab/NA9YS/ggF+JwrDXOsBkyV8fFC2 jI/ju3haBVI/x5dlU4+lCtEN8Ek9qw15D9xe1Eh2LC0CLEhbR+unwYh7exVwySjW6Dhk6O/YeFv MKRbBnRwwLmzTZpTcaVd93UrLeqTDW91N3ZPUAdK0rjJG+RmCAS7EfOozPHDPUZF/dGzxpNwsRF 1k52bbf/Ta6Ti1QSxErp4BaChE0A5TYsvcHIVfOIHI= X-Received: by 2002:a17:907:94d4:b0:c20:367b:acae with SMTP id a640c23a62f3a-c2073431341mr473270066b.32.1786117527762; Fri, 07 Aug 2026 08:45:27 -0700 (PDT) Received: from google.com (135.91.155.104.bc.googleusercontent.com. [104.155.91.135]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-c2080cc3963sm67670466b.50.2026.08.07.08.45.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 07 Aug 2026 08:45:27 -0700 (PDT) Date: Fri, 7 Aug 2026 16:45:23 +0100 From: Vincent Donnefort To: Steven Rostedt Cc: Masami Hiramatsu , linux-trace-kernel@vger.kernel.org, mathieu.desnoyers@efficios.com, kernel-team@android.com, linux-kernel@vger.kernel.org Subject: Re: [PATCH 1/6] ring-buffer: Prevent resizing of persistent ring buffer Message-ID: References: <20260806211306.3704194-1-vdonnefort@google.com> <20260806211306.3704194-2-vdonnefort@google.com> <20260807111808.d5dc1a48b080d241100f4a57@kernel.org> <20260807104526.38430aa2@gandalf.local.home> 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-Disposition: inline In-Reply-To: On Fri, Aug 07, 2026 at 04:25:33PM +0100, Vincent Donnefort wrote: > On Fri, Aug 07, 2026 at 10:45:26AM -0400, Steven Rostedt wrote: > > On Fri, 7 Aug 2026 10:43:12 +0100 > > Vincent Donnefort wrote: > > > > > On Fri, Aug 07, 2026 at 09:14:26AM +0100, Vincent Donnefort wrote: > > > > On Fri, Aug 07, 2026 at 11:18:08AM +0900, Masami Hiramatsu wrote: > > > > > On Thu, 6 Aug 2026 22:13:01 +0100 > > > > > Vincent Donnefort wrote: > > > > > > > > > > > Dynamically resizing a persistent ring buffer is not possible. Disable > > > > > > the feature. > > > > > > > > > > Is it true? Of course there is meaningless to resize the persistent > > > > > ring buffer (because it makes the buffer none-persistent), we are currently > > > > > allows user to resize it (like for resizing unused persistent ring buffer) > > > > > > > > __rb_allocate_pages() in ring_buffer_resize() would call for a persistent buffer > > > > rb_range_buffer(), which IIUC, is just reusing the same ring buffer pages as the > > > > one already in the persistent buffer. > > > > > > I have just tried and if reducing the size works, increasing fails in both > > > rb_set_head_page() and rb_insert_pages() with a warning, which I believe is > > > expected. > > > > > > We could improve that, but it feels like it is a lot of work for a meaningless > > > feature which we should just disable? > > > > Resizing a persistent ring buffer to a smaller size may be allowed, but I > > see no point in increasing the size. Making it smaller should allow us to > > give back a portion of the persistent ring buffer for general usage. > > > > -- Steve > > While I see the appeal to reclaim that memory, I don't think we have any good > interface for that. There is no nice way to get the list of pages that have been > freed and we have no control over what part of the ring-buffer is removed. > > Also, as this memory is from a reserved-range, is there really a way to re-inject > it into the buddy allocator? free_reserved_page() would do actually. But then it is definitive. Happy to implement something like that. That also means that the instance can be actually freed? > > Perhaps what would make sense for resizing would be to support a CMA pool as a > persistent buffer? > > -- > Vincent -- Vincent