Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp133396rwl; Thu, 6 Apr 2023 16:08:37 -0700 (PDT) X-Google-Smtp-Source: AKy350YK6vJ1VXvOESo6U8dIzTBS3UtAqMm3FLOxcHsc4AH4eGM7b7FSKQ11+4l0ULZtuhxc1L4E X-Received: by 2002:a17:903:2441:b0:19c:bcb1:d8c3 with SMTP id l1-20020a170903244100b0019cbcb1d8c3mr616258pls.54.1680822517622; Thu, 06 Apr 2023 16:08:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680822517; cv=none; d=google.com; s=arc-20160816; b=Wg+9k5/UD6lprBzNOgQuoG7REayICJKbNhukaVb2816oTsiAJaSOTcVNZVEnONemmb N9fXOd5jT5m4QO1T9meR/xmxLYbe/1grcZRdiiLVFakcgWiLBJ9KKvHjRWxrN/g2bt90 esnvQjwWx7LoN75u2SQWE3Sej9avLRmMPMvBSL+H9OivSTvjx7g6Yi9sGBSRyUv884xE ce9KxFkRtUU/wnAnZbW204otptr2clhaaTZYE1WAuvGoF9N8foNWy/eStlr1tPwefd5r rtx12tauuSoJXji4al/Y5wDx6rgjAflLGJIOXSeOEv8/+szngNCczhEpS5fbcpibl6jn Cqwg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=l9mouClcu4nfSH3QfrDh7zzf/9xgQz6Zbc/hKh+wblo=; b=H8gcctW0FUt7xEMwDQ9odOXC3GB+2SMFLNMqvEaqwfRwEF6OR/1c6Cz2JCB9gyawZL lvLken/kWJTBb65EZY+hGPJ6R29Xqu3o3aybWcFfdQotQXCUJFy7Wlw4C3noJKpjo69q JUCz3EQqqDFdbOztJSjrJu/Coqk0mUZlzP+blFU2ZeKV5VL7QYhEvaTbvtN/XGtnupKN O2EdPDsknvFxUEEtCGILTLJhlfAlloN9yBnt+L7oyfYYIL3loqN9Ws067Qt97gpGXL0x ZGPSEa8isaheXM7/xZ63zXwS9DH/6l1KgnOugElip0IOmCVrlMIkI481BkydPyXKu8NI ANiw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=korg header.b=VPxzw7lh; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id j16-20020a170902da9000b0019e69892709si2796726plx.596.2023.04.06.16.08.23; Thu, 06 Apr 2023 16:08:37 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=korg header.b=VPxzw7lh; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231924AbjDFWo1 (ORCPT + 99 others); Thu, 6 Apr 2023 18:44:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53762 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230210AbjDFWo0 (ORCPT ); Thu, 6 Apr 2023 18:44:26 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 802A793F7 for ; Thu, 6 Apr 2023 15:44:25 -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 1B42464B83 for ; Thu, 6 Apr 2023 22:44:25 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 56AC2C433EF; Thu, 6 Apr 2023 22:44:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1680821064; bh=hePkiz4mZ331h2P6XlWg7tPrOwSzlUT0/Se3rTSdPX4=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=VPxzw7lhaAGELngejI5UV7bUtG+uPGUP12mrFXj3nAf78kjSDURF8dkO7xNGaa96l RjxJQ2gR8p5GAH9vu0VFlrER3Otxu4RyLxzVHx+DO029EvH7boQ+j5DppkMsey1qgd e7BekUPzKJWacD7gUdKs93vjs/uknYY7Ls8hbsKc= Date: Thu, 6 Apr 2023 15:44:23 -0700 From: Andrew Morton To: Mike Rapoport Cc: "Kirill A. Shutemov" , Guenter Roeck , linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] mm-treewide-redefine-max_order-sanely-fix.txt Message-Id: <20230406154423.20a991bbdd47630fc38d94e8@linux-foundation.org> In-Reply-To: References: <9460377a-38aa-4f39-ad57-fb73725f92db@roeck-us.net> <20230406072529.vupqyrzqnhyozeyh@box.shutemov.name> <83e6bc46-dfc0-0e95-e69c-5b996af1e50b@roeck-us.net> <20230406151015.yndcm24fyxitvqyc@box.shutemov.name> X-Mailer: Sylpheed 3.8.0beta1 (GTK+ 2.24.33; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-7.4 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 7 Apr 2023 00:14:31 +0300 Mike Rapoport wrote: > > > Shouldn't that be > > > else > > > order = 0; > > > ? > > > > +Mike. > > > > No. start == 0 is MAX_ORDER-aligned. We want to free the pages in the > > largest chunks alignment allows. > > Right. Before the changes to MAX_ORDER it was > > order = min(MAX_ORDER - 1UL, __ffs(start)); > > which would evaluate to 10. > > I'd just prefer the comment to include the explanation about why we choose > MAX_ORDER for start == 0. Say > > /* > * __ffs() behaviour is undefined for 0 and we want to free the > * pages in the largest chunks alignment allows, so set order to > * MAX_ORDER when start == 0 > */ Meanwhile I'd like to fix "various boot failures (hang) on arm targets" in -next, so I queued up Kirill's informal fix for now.