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 5B045C6FD1D for ; Fri, 17 Mar 2023 08:50:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229820AbjCQIuI (ORCPT ); Fri, 17 Mar 2023 04:50:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53802 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231611AbjCQIt4 (ORCPT ); Fri, 17 Mar 2023 04:49:56 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 812C7509B4; Fri, 17 Mar 2023 01:49:36 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 2B2666221F; Fri, 17 Mar 2023 08:49:26 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D7303C433D2; Fri, 17 Mar 2023 08:49:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1679042965; bh=ykt+2ZCz3fJnDj9RH3P/+IvPyVarY3iXaWoZy2um+KQ=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=ASlDJrZelehzIwW2Z9VzYs6Yymp4sfhk+lPTy1rfj7IMYKry3XAmgaEkxvKDPNLuo UKP1933d6dTIUg9+GFtsFk6iiwHfK3dtxpHxb/0jUE4K/rErFB2RmpNA8ZsANeTj1u 18FxT5XPdx30MtVkPfwqtMZeDoDeAFrXHS1qQ9ndhOtdA1yFGgtnHORVFmfSVop1F3 s5XO3h1/KbvYLFpyFzBoSMWLGIelKa/6Lp+Lk0ydn3t1z7D2+4+qiifR8aLa91xvO5 LZsjEcZiG1OND+JJiZFUrNqNGEI1k8c+hS7BmRP45mhj9VU5hfyOtGmH2c3+iNJ1eU R5ZP2HY3NSONQ== Date: Fri, 17 Mar 2023 10:49:11 +0200 From: Mike Rapoport To: "Kirill A. Shutemov" Cc: Andrew Morton , Mel Gorman , Vlastimil Babka , David Hildenbrand , linux-mm@kvack.org, linux-arch@vger.kernel.org, linux-kernel@vger.kernel.org, Richard Weinberger , Anton Ivanov , Johannes Berg Subject: Re: [PATCH 02/10] um: Fix MAX_ORDER usage in linux_main() Message-ID: References: <20230315113133.11326-1-kirill.shutemov@linux.intel.com> <20230315113133.11326-3-kirill.shutemov@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230315113133.11326-3-kirill.shutemov@linux.intel.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Mar 15, 2023 at 02:31:25PM +0300, 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 linux_main(). > > Signed-off-by: Kirill A. Shutemov > Cc: Richard Weinberger > Cc: Anton Ivanov > Cc: Johannes Berg Acked-by: Mike Rapoport (IBM) > --- > arch/um/kernel/um_arch.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/arch/um/kernel/um_arch.c b/arch/um/kernel/um_arch.c > index 8dcda617b8bf..5e5a9c8e0e5d 100644 > --- a/arch/um/kernel/um_arch.c > +++ b/arch/um/kernel/um_arch.c > @@ -368,10 +368,10 @@ int __init linux_main(int argc, char **argv) > max_physmem = TASK_SIZE - uml_physmem - iomem_size - MIN_VMALLOC; > > /* > - * Zones have to begin on a 1 << MAX_ORDER page boundary, > + * Zones have to begin on a 1 << MAX_ORDER-1 page boundary, > * so this makes sure that's true for highmem > */ > - max_physmem &= ~((1 << (PAGE_SHIFT + MAX_ORDER)) - 1); > + max_physmem &= ~((1 << (PAGE_SHIFT + MAX_ORDER - 1)) - 1); > if (physmem_size + iomem_size > max_physmem) { > highmem = physmem_size + iomem_size - max_physmem; > physmem_size -= highmem; > -- > 2.39.2 > -- Sincerely yours, Mike.