Received: by 2002:a05:7412:e794:b0:fa:551:50a7 with SMTP id o20csp2874480rdd; Sat, 13 Jan 2024 05:38:39 -0800 (PST) X-Google-Smtp-Source: AGHT+IGAfBe8BiTSCZEx/eY+cWS6vYh8MNfK7rQRwEIw2tR8d+l+vL8/OyJqF0Fyk2ie3ug5jZ4y X-Received: by 2002:a05:6808:3c94:b0:3bd:5eec:ca0d with SMTP id gs20-20020a0568083c9400b003bd5eecca0dmr3689146oib.116.1705153119607; Sat, 13 Jan 2024 05:38:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1705153119; cv=none; d=google.com; s=arc-20160816; b=uIIOsDKbHEqdNLyjTkQTvMmJRjbBLgvrhnkgKxtjSuTlB7oc88l/ecMtadPlqJud3u Q6shKKoidLaPIe8znLOKNOuGLaYO6ccq/r++7cJgNnay7XW5YMkXQMOlS3c+TszG0qqd uyPfL6DfQ0thzFxEal7Es7lkrTgpmXWd+raJFopentnrmRiXd0KfsCXEkrlzI0AzN+pG 1nqHkf0b7jzitVe0a9My3mPzEjnRzZ6GMWimgoj620GzmyZsQmlS8J31sIel0CXFQCya +u8k2XdSfbkWhky1r4X31fQuOIcLJjXBucIzhaUArH252hh2tf0jlOl8ZkDN5JxyCdtj Vvpw== ARC-Message-Signature: i=1; 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:references:in-reply-to:message-id :subject:cc:to:from:date:dkim-signature; bh=S3azlDhAcvxwKQ/IADL6E/siyOLnK34Ut82bEcWTIsc=; fh=m81CCTuCbCiEBQNSfKwMhBKHJZmcJ/zxh0iGF2IisCs=; b=kyCNGsDddHAuH8eCD/iOukWiSQBMK26goi+ZjIk/LCW89ev9TnHmwYIwy+8Gztp7Ze czGOzU1cXvJG0uHIv7GM05wTrRemFtaGRKTQ5RSEwPnUM3wRHs0BJphFK+6JY2tq225q S318ET7Pc5TFKmKEpg0bMuDSlNuFhymWMqfnUbrwvT4QI4DAU+1DLxbpEC6Kazx2GEkz 7GJedV67+4OrZXzsifZuFcDZyHCfUtKJ4lw1hFmfaYxOGw8UH0SoIVWCdVzhJriS7jOY qDlCuSGvm2SlqHeVeltzjcqj/AzSa+i3/pJ8jn+b8FRjl3D+sQ2+Xsx4gsmNmwG1U1ja ompg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=jE7vgett; spf=pass (google.com: domain of linux-kernel+bounces-25294-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-25294-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id i8-20020a632208000000b005cdf7386eabsi5305886pgi.885.2024.01.13.05.38.39 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 13 Jan 2024 05:38:39 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-25294-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=jE7vgett; spf=pass (google.com: domain of linux-kernel+bounces-25294-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-25294-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org 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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 2A4EEB22AF1 for ; Sat, 13 Jan 2024 13:38:36 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 07FBB21119; Sat, 13 Jan 2024 13:38:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="jE7vgett" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 31401210F5; Sat, 13 Jan 2024 13:38:28 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id F07C7C433F1; Sat, 13 Jan 2024 13:38:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1705153108; bh=SC7yxX48nNARM4zUOANK65x2NyUG2tY3vzPMRpzF+LM=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=jE7vgettR+MRr/hJePpzqL/3b14WDhBRhyrYPfY9Gb3wtzC7OTRCkuMoE1Gwd5102 +8qNv8U7UGCVrxOvoDmdr7FGSY13M3qryfAs98IaOqG4efcbgccIe0rgD9SW2grxOH n0+odZa1vSn4gWFT6bt4EZRwhOdiUPOBPISXtjhEtMwrC1w9ojQv79QH8QwCm7csLF +QInt34OnInHL0L8nR3rlGfRc9Td2F8gL0SK5po1QmJ4bI0blEk5qYymaUsELqzDTB EvgJolaqSomy2Ct3sfY5Abvy3TZE2qZ8iHEXwzlA6d6sgX7ypFk764HQCjJwlYPfDi 71QMcnDZYd2TQ== Date: Sat, 13 Jan 2024 22:38:24 +0900 From: Masami Hiramatsu (Google) To: Vincent Donnefort Cc: rostedt@goodmis.org, linux-kernel@vger.kernel.org, linux-trace-kernel@vger.kernel.org, mathieu.desnoyers@efficios.com, kernel-team@android.com Subject: Re: [PATCH v11 1/5] ring-buffer: Zero ring-buffer sub-buffers Message-Id: <20240113223824.3e9eed42cf10748e4255afde@kernel.org> In-Reply-To: <20240111161712.1480333-2-vdonnefort@google.com> References: <20240111161712.1480333-1-vdonnefort@google.com> <20240111161712.1480333-2-vdonnefort@google.com> X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.33; x86_64-pc-linux-gnu) 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 Thu, 11 Jan 2024 16:17:08 +0000 Vincent Donnefort wrote: > In preparation for the ring-buffer memory mapping where each subbuf will > be accessible to user-space, zero all the page allocations. > > Signed-off-by: Vincent Donnefort Looks good to me. Reviewed-by: Masami Hiramatsu (Google) Thank you! > > diff --git a/kernel/trace/ring_buffer.c b/kernel/trace/ring_buffer.c > index 173d2595ce2d..db73e326fa04 100644 > --- a/kernel/trace/ring_buffer.c > +++ b/kernel/trace/ring_buffer.c > @@ -1466,7 +1466,8 @@ static int __rb_allocate_pages(struct ring_buffer_per_cpu *cpu_buffer, > > list_add(&bpage->list, pages); > > - page = alloc_pages_node(cpu_to_node(cpu_buffer->cpu), mflags, > + page = alloc_pages_node(cpu_to_node(cpu_buffer->cpu), > + mflags | __GFP_ZERO, > cpu_buffer->buffer->subbuf_order); > if (!page) > goto free_pages; > @@ -1551,7 +1552,8 @@ rb_allocate_cpu_buffer(struct trace_buffer *buffer, long nr_pages, int cpu) > > cpu_buffer->reader_page = bpage; > > - page = alloc_pages_node(cpu_to_node(cpu), GFP_KERNEL, cpu_buffer->buffer->subbuf_order); > + page = alloc_pages_node(cpu_to_node(cpu), GFP_KERNEL | __GFP_ZERO, > + cpu_buffer->buffer->subbuf_order); > if (!page) > goto fail_free_reader; > bpage->page = page_address(page); > @@ -5525,7 +5527,8 @@ ring_buffer_alloc_read_page(struct trace_buffer *buffer, int cpu) > if (bpage->data) > goto out; > > - page = alloc_pages_node(cpu_to_node(cpu), GFP_KERNEL | __GFP_NORETRY, > + page = alloc_pages_node(cpu_to_node(cpu), > + GFP_KERNEL | __GFP_NORETRY | __GFP_ZERO, > cpu_buffer->buffer->subbuf_order); > if (!page) { > kfree(bpage); > -- > 2.43.0.275.g3460e3d667-goog > -- Masami Hiramatsu (Google)