Received: by 2002:ab2:6a05:0:b0:1f8:1780:a4ed with SMTP id w5csp521697lqo; Fri, 10 May 2024 07:05:10 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWyM6H9Ce46cjWjhp6U/v8INPmCulNtf+xNgHLdPVGlf/Bii/oZ2bpKhdcq5utQMKQCvz7VHVE4h3xlHulj1llIXtNixOIzyDdxNT73Pg== X-Google-Smtp-Source: AGHT+IERb8aPDqqHGzRi60kofmNM/4xRpNhDCAeP9s9qbmWQPO4y7V0RjJP8gphZM6SgKh8riFVw X-Received: by 2002:a05:622a:5917:b0:43a:cc86:568d with SMTP id d75a77b69052e-43dfdb291b4mr39389051cf.23.1715349909674; Fri, 10 May 2024 07:05:09 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715349909; cv=pass; d=google.com; s=arc-20160816; b=eBTCZNQwm47qjOxTbE48s7P9iNOr//s5kKRhe03wt6n8DFKt33v6ddxhp6DsVa3ki2 oJggWbkxmT0aV4BJKyMt2y1Ki9hcpMsH2+073Tntu/EhNdx/WN+Uj47JHzE8zMhjQIR0 e/hra6+9f8S5MmdMqp64/ITxuvbhdY9867KMwLXZ49I2kyaKKa7F/tQRzPIB8xli8b+Z 0SY/Z449d7xKqnEuLhU7CDrlRGC+50Zg90TEFmw8q8z4cm+72X3tOqpCkr4wc2qgswG9 AKMYxR8lQNXLpMKD0Zldwp0tUdfSxlUCXeUESBWALAuzvzH3AWl97FWVXJvkdICMIr1f G/Nw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:from:subject:message-id:references:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:in-reply-to:date :dkim-signature; bh=JnCpfZnwxk3j+z1aMY5Xz+L+IXVW2XNLvHkBjDivyKk=; fh=OpBEHpVW27GvuslqkdqzyOm68W3MtLSK2v3WklzjKM4=; b=j2aqEfQkENRpUYQBCPNSqd36SadVWoObayDCMlSzqsIRQjTvdQ6YktULcDahdu8ML1 GoXH9a7yc5wLHH/Yx21YxO0QQA5qHIR+JCMacomsl+cZr7pbYB2v4WL6CoX4Yy6QatFv Xby3QM3nQn4bHbz0Ap/tL88G4ZrI+Ug63RDeQVsU9rgaZZ0Tqeh3kUnVmhNZSWY0OS4g 9GepsHyvPMUUMRi6mH3nGfqx3EpgXC4HsUN35A0n576+x67v2QWBrbQ1ymVFb8CfXXwZ Symt54YSeCoWkkjvFtAhe2nN/6xquyJASQ/cO+59h/byGiZkL342Kfd5+mVg9bCwsqXe IUvw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=O0tvWHfb; arc=pass (i=1 spf=pass spfdomain=flex--vdonnefort.bounces.google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-175853-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-175853-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id d75a77b69052e-43df56d3d57si36415591cf.668.2024.05.10.07.05.09 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 10 May 2024 07:05:09 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-175853-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=O0tvWHfb; arc=pass (i=1 spf=pass spfdomain=flex--vdonnefort.bounces.google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-175853-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-175853-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 5AB261C21305 for ; Fri, 10 May 2024 14:05:09 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 6397E16EC0B; Fri, 10 May 2024 14:04:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="O0tvWHfb" Received: from mail-wr1-f74.google.com (mail-wr1-f74.google.com [209.85.221.74]) (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 00E441311B9 for ; Fri, 10 May 2024 14:04:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.74 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715349885; cv=none; b=mMxM9tIs2BZq15YpAWhmh7JOr4x3yHi0ngH6E5RYJjxWuKyMtb12JjRSci03da/81FzHPzKm75MW4ey7yw748R6DNhsbKxceLdgaGvyPFLnrmGZ/y/n+zhAGV6tBImVoyD1NTRKxM16DW6M5PR033ac4OwBi54FLAiqa2MjcyxA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715349885; c=relaxed/simple; bh=SZOR+cdwvHoOQJtmOOG1N3KpDv0/bZPsbnxNNIa91OQ=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=FfFPYoo8POXZ0RQX0JIBZSBgBRCbl1/NsUYLIbIPuwzODd08QE2v89DRYJLeot5s2AWCTKGPjeKg6Ojrnow7zJhvtrD8Smrw3qgyfpKkQ4XVOwsx7yl8maZLRHGyP7cvXoyA+Udg4oMUST2jhDSwFM09050UZoL35hM/yfRxmBI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--vdonnefort.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=O0tvWHfb; arc=none smtp.client-ip=209.85.221.74 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--vdonnefort.bounces.google.com Received: by mail-wr1-f74.google.com with SMTP id ffacd0b85a97d-34deefe9142so1178553f8f.0 for ; Fri, 10 May 2024 07:04:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1715349882; x=1715954682; 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=JnCpfZnwxk3j+z1aMY5Xz+L+IXVW2XNLvHkBjDivyKk=; b=O0tvWHfbskQQp3QLPGx0I3HM6sYGfNA59QSt/LPAJUhAP0WHISQcbEydjmS+l55Ev7 6CQ/iN0CAJttNUimJcl5iguMf7QcmzDAl2P2ZhQ+YkQYZB+SM7uLbfHAevt2k/bcRB+Z 2tT7745TPpAhCm90ezNio6YGVGOq1SJqpYBte+T8h/tQ2SeblccMKXNI4MfjJ097QYVY EvZBqcPgN7ytFmW6yfPYJBKfT5xGngG3Op+vqhsdr2eGctRH7D1fHvms86jkgPaczlVC Ma+BQgYYEioxTEjqPN8ThRv3uN0vauKX4GI9peFoWqN8pNAZqqNAyByZ5K9ifU+2rKXw lYWA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715349882; x=1715954682; 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=JnCpfZnwxk3j+z1aMY5Xz+L+IXVW2XNLvHkBjDivyKk=; b=g32QCOp41Svw+v5ehz5lCY71KJ15103Os5lv5+i+xI4Zyz641u5NBSByQNYP1QrxIB VOKcKW5bfg2t/O0qqUP/YHn9JCK6qEqE3iKg224YTMkwRyUzHZlc6hLBjE+NVOhkYKMP MVfO7gWKSuH8UQrgPEejN1uCUqKfcmzUDFlzrkH3vMF/Y840Vj3KipInTEstFaIyTz8b 6vttb/PySdUvuFL8bPgiC8ObaWnPzCwB18as62O5LenpbDGQdy2im23D+HAzGCmP3CsK OFa7YFy9z7AUCCqE1PJgS1BiQ9CCH2v7wQTMDcZY+L9xSH9DAQ3CeWN5gsqXCs/SE9+L PV8w== X-Forwarded-Encrypted: i=1; AJvYcCWFhHEMjP/cIdOKQY7CnyjeH8DN4cbydT3vquXKBOw4KXfdYPb7lwaJ8XND7/KRMSqf2/3hnzH3CMf6S1vwpdWvKxVOxMJy3M0RHWpv X-Gm-Message-State: AOJu0YwXrL1ccAdMeOnmQNXuB2EKhFQDOJ4FKfmi8NMYJOJFLfh0i6Sr 6oTYM26Y6GXJ2rXd4ihGwZSp/E18D4Sb/4AtFjcuOB565dGaG7yZmfLEt8QLkyhAGXz6qRoKrQC n7N1Bhlx15SzRE0H2eQ== X-Received: from vdonnefort.c.googlers.com ([fda3:e722:ac3:cc00:28:9cb1:c0a8:2eea]) (user=vdonnefort job=sendgmr) by 2002:a5d:5943:0:b0:349:ba19:6e4d with SMTP id ffacd0b85a97d-3504a736156mr6749f8f.7.1715349881300; Fri, 10 May 2024 07:04:41 -0700 (PDT) Date: Fri, 10 May 2024 15:04:30 +0100 In-Reply-To: <20240510140435.3550353-1-vdonnefort@google.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20240510140435.3550353-1-vdonnefort@google.com> X-Mailer: git-send-email 2.45.0.118.g7fe29c98d7-goog Message-ID: <20240510140435.3550353-2-vdonnefort@google.com> Subject: [PATCH v23 1/5] ring-buffer: Allocate sub-buffers with __GFP_COMP From: Vincent Donnefort To: rostedt@goodmis.org, mhiramat@kernel.org, linux-kernel@vger.kernel.org, linux-trace-kernel@vger.kernel.org Cc: mathieu.desnoyers@efficios.com, kernel-team@android.com, rdunlap@infradead.org, rppt@kernel.org, david@redhat.com, Vincent Donnefort Content-Type: text/plain; charset="UTF-8" In preparation for the ring-buffer memory mapping, allocate compound pages for the ring-buffer sub-buffers to enable us to map them to user-space with vm_insert_pages(). Acked-by: David Hildenbrand Signed-off-by: Vincent Donnefort diff --git a/kernel/trace/ring_buffer.c b/kernel/trace/ring_buffer.c index 25476ead681b..cc9ebe593571 100644 --- a/kernel/trace/ring_buffer.c +++ b/kernel/trace/ring_buffer.c @@ -1524,7 +1524,7 @@ 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 | __GFP_ZERO, + mflags | __GFP_COMP | __GFP_ZERO, cpu_buffer->buffer->subbuf_order); if (!page) goto free_pages; @@ -1609,7 +1609,7 @@ 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 | __GFP_ZERO, + page = alloc_pages_node(cpu_to_node(cpu), GFP_KERNEL | __GFP_COMP | __GFP_ZERO, cpu_buffer->buffer->subbuf_order); if (!page) goto fail_free_reader; @@ -5579,7 +5579,7 @@ ring_buffer_alloc_read_page(struct trace_buffer *buffer, int cpu) goto out; page = alloc_pages_node(cpu_to_node(cpu), - GFP_KERNEL | __GFP_NORETRY | __GFP_ZERO, + GFP_KERNEL | __GFP_NORETRY | __GFP_COMP | __GFP_ZERO, cpu_buffer->buffer->subbuf_order); if (!page) { kfree(bpage); -- 2.45.0.118.g7fe29c98d7-goog