Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1F00DC74A5B for ; Tue, 21 Mar 2023 08:00:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229904AbjCUIAK (ORCPT ); Tue, 21 Mar 2023 04:00:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43100 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229497AbjCUIAG (ORCPT ); Tue, 21 Mar 2023 04:00:06 -0400 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CF5CA3B846; Tue, 21 Mar 2023 01:00:04 -0700 (PDT) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 8D78721A7C; Tue, 21 Mar 2023 08:00:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1679385603; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=sUwEiqw/SKliyyK0F22lRGPEA7rIU5pf46IYT4psqJ8=; b=AO02s6ujgE27wmr4i7t4eIh7XSbBk/phGyn8LsRKqi4PjG0Tz70wgbhgtZlZF9UB9/Iwru HUjYssvFNMoGPN3nj4yxDA3NU6MwoKZqRIBOrKN7MoLiikq2pv8Wn+yKwMQnmtCyc0og09 zyKZ1FuPWC+s4bHkLOOHha1f0kMjEDk= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1679385603; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=sUwEiqw/SKliyyK0F22lRGPEA7rIU5pf46IYT4psqJ8=; b=nxfG6i+EiDjiMqChCtl0kgOT7OwNopMs7qj6wHESD6njKb+Z7pckCih0Ts74LL/PaLWvWh HPdFxNVafKxhPIDA== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 4A59013440; Tue, 21 Mar 2023 08:00:03 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id 8vpvEQNkGWTHOQAAMHmgww (envelope-from ); Tue, 21 Mar 2023 08:00:03 +0000 Message-ID: <93b37049-af7e-3408-37bf-805f633271e4@suse.cz> Date: Tue, 21 Mar 2023 09:00:03 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.8.0 Subject: Re: [PATCH 06/10] perf/core: Fix MAX_ORDER usage in rb_alloc_aux_page() Content-Language: en-US To: "Kirill A. Shutemov" , Andrew Morton , Mel Gorman , David Hildenbrand Cc: linux-mm@kvack.org, linux-arch@vger.kernel.org, linux-kernel@vger.kernel.org, Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Mark Rutland , Alexander Shishkin , Jiri Olsa , Namhyung Kim , Ian Rogers , Adrian Hunter References: <20230315113133.11326-1-kirill.shutemov@linux.intel.com> <20230315113133.11326-7-kirill.shutemov@linux.intel.com> From: Vlastimil Babka In-Reply-To: <20230315113133.11326-7-kirill.shutemov@linux.intel.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 3/15/23 12:31, Kirill A. Shutemov wrote: > MAX_ORDER is not inclusive: the maximum allocation order buddy allocator > can deliver is MAX_ORDER-1. > > Fix MAX_ORDER usage in rb_alloc_aux_page(). > > Signed-off-by: Kirill A. Shutemov Acked-by: Vlastimil Babka > Cc: Peter Zijlstra > Cc: Ingo Molnar > Cc: Arnaldo Carvalho de Melo > Cc: Mark Rutland > Cc: Alexander Shishkin > Cc: Jiri Olsa > Cc: Namhyung Kim > Cc: Ian Rogers > Cc: Adrian Hunter > --- > kernel/events/ring_buffer.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/kernel/events/ring_buffer.c b/kernel/events/ring_buffer.c > index 273a0fe7910a..d6bbdb7830b2 100644 > --- a/kernel/events/ring_buffer.c > +++ b/kernel/events/ring_buffer.c > @@ -609,8 +609,8 @@ static struct page *rb_alloc_aux_page(int node, int order) > { > struct page *page; > > - if (order > MAX_ORDER) > - order = MAX_ORDER; > + if (order >= MAX_ORDER) > + order = MAX_ORDER - 1; > > do { > page = alloc_pages_node(node, PERF_AUX_GFP, order);