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 2E16EC6FD1D for ; Tue, 21 Mar 2023 08:02:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229931AbjCUICI (ORCPT ); Tue, 21 Mar 2023 04:02:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45144 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230374AbjCUIB6 (ORCPT ); Tue, 21 Mar 2023 04:01:58 -0400 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3F0383928F; Tue, 21 Mar 2023 01:01:56 -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 DA75C21A7C; Tue, 21 Mar 2023 08:01:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1679385714; 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=ctS+eKV0U5OIdHV3xnU3MmgGcrolUtwAToziodkFTXQ=; b=j55E7TVWuklZamsfwYqXgOHP+fWCAZ2tGRT5x7bQjlk1kBu2/SjlvPQw6E9FKUHaPudmkj un9PVnQw/lXKgrLiq7S2u/JanY88w5/Tk+l9hhYYU7H01VcAo5shYeRxIXLm/xZEZtRhff vjs2z8HcwLOtqdMVAeLA38fmOzlVGK0= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1679385714; 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=ctS+eKV0U5OIdHV3xnU3MmgGcrolUtwAToziodkFTXQ=; b=5rCAUXh9BgcbPrucB5nQUS11Y73lHAQGezjezAFYeMah7RiMKbDcGyvQU+p0l3Ue93dIBM 2WtgWFX0ziQDQuCA== 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 B3D3A13440; Tue, 21 Mar 2023 08:01:54 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id n9oqK3JkGWS6OgAAMHmgww (envelope-from ); Tue, 21 Mar 2023 08:01:54 +0000 Message-ID: <3f85d13e-5faa-ca0b-5ef5-79422bbae7a5@suse.cz> Date: Tue, 21 Mar 2023 09:01:54 +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 07/10] mm/page_reporting: Fix MAX_ORDER usage in page_reporting_register() 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, Alexander Duyck References: <20230315113133.11326-1-kirill.shutemov@linux.intel.com> <20230315113133.11326-8-kirill.shutemov@linux.intel.com> From: Vlastimil Babka In-Reply-To: <20230315113133.11326-8-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 page_reporting_register(). > > Signed-off-by: Kirill A. Shutemov Reviewed-by: Vlastimil Babka > Cc: Alexander Duyck > --- > mm/page_reporting.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/mm/page_reporting.c b/mm/page_reporting.c > index c65813a9dc78..275b466de37b 100644 > --- a/mm/page_reporting.c > +++ b/mm/page_reporting.c > @@ -370,7 +370,7 @@ int page_reporting_register(struct page_reporting_dev_info *prdev) > */ > > if (page_reporting_order == -1) { > - if (prdev->order > 0 && prdev->order <= MAX_ORDER) > + if (prdev->order > 0 && prdev->order < MAX_ORDER) > page_reporting_order = prdev->order; > else > page_reporting_order = pageblock_order;