Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp3067745rdg; Tue, 17 Oct 2023 03:46:50 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHg6h/nMyCCvIPmavcCuTO+IVmr9HvVnuznVSFdhf/fMMvo/aQP4Qf/fvnGLTzMQCewpgGV X-Received: by 2002:a05:6902:4e9:b0:d9b:405:a106 with SMTP id w9-20020a05690204e900b00d9b0405a106mr1555896ybs.14.1697539610040; Tue, 17 Oct 2023 03:46:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697539609; cv=none; d=google.com; s=arc-20160816; b=kJfgejMI2E15DzcaYEmXnC+TzygdBKGbQytMTUHgCDAk7KnHeW9nsSCbqDunbDVh8q hcuQ4A6hG+tLlJPzaeUu9u8iXKF3I/xKpTnH2tfhl7FbIiOqcBR4QVL6whxaA6HcFvw9 iYl2Q4KQbyHCifEZQN5fB6N7yAJz5cEn29n1LSslVUOKjLoQCwQ0xJZdtPQMJN7rPaQE iVPzJ5CEDeItqMXHujLBlcoQYOUuTspQjF/HzQzn+4UDhAdHbgRItl6fGdz6nh1jHS36 g0EIS08YKjYdIKumeHmFk3ft+dru7I7ssVXb9YKCY+P2dWckkfO+KH3EzaWUGMBrXRXm QN4Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=m671g35jVHurr8wOcj+WlvlYKhYnYhlvUxsN6VNvRGY=; fh=Ya/dp3n0oBclQ1xi7UXnQiSAhLURl8q2Yccy0qrS/c4=; b=rdyDaLbhSMI6GUpHW0XmacYqqaZobL9dwZ0fnK2pXnY69J8xBuZEaxg8bhiQSxo6ay UwEbOlPae2S/DQnCKZd7WzdH4Ip3yhFGYxXDKdl/uafyiGYLOzxULxTKA4Nq59Sej+UE SsisN5DyXw9SUfUlTQKFPLg4CT1+R8xTCqYbRw31qvksF1Pftn4dUvQcwZWQGW7Qc+R1 GmQZ7erDebo7xaM+6uzbXTl2hFqiW//NXHWC4a107KS8UfCk9XWhgfqegpjIjldCOAkD yZ/Y2CvbsxgbEb54+30FOUetbXAWrWAaNfk3NJKAmWhNDC+AX22LsUEcQgL+OE/KwFwW 7sEg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ucw.cz header.s=gen1 header.b=r0HGqmvv; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=ucw.cz Return-Path: Received: from agentk.vger.email (agentk.vger.email. [2620:137:e000::3:2]) by mx.google.com with ESMTPS id i23-20020aa796f7000000b006bd32d1a300si1327397pfq.355.2023.10.17.03.46.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Oct 2023 03:46:49 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) client-ip=2620:137:e000::3:2; Authentication-Results: mx.google.com; dkim=pass header.i=@ucw.cz header.s=gen1 header.b=r0HGqmvv; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=ucw.cz Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id D265F8036853; Tue, 17 Oct 2023 03:46:47 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1343599AbjJQKql (ORCPT + 99 others); Tue, 17 Oct 2023 06:46:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48930 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234608AbjJQKqk (ORCPT ); Tue, 17 Oct 2023 06:46:40 -0400 Received: from jabberwock.ucw.cz (jabberwock.ucw.cz [46.255.230.98]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A4117A2; Tue, 17 Oct 2023 03:46:38 -0700 (PDT) Received: by jabberwock.ucw.cz (Postfix, from userid 1017) id 59C431C006A; Tue, 17 Oct 2023 12:46:37 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ucw.cz; s=gen1; t=1697539597; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=m671g35jVHurr8wOcj+WlvlYKhYnYhlvUxsN6VNvRGY=; b=r0HGqmvvNd5g7CMrbD4jPXD4pgEr6r1Gm6it6Yn8e+jW1rZb4R31EB/0rxa/Ub2tjKQADj GRrPxQw0JGiR3agauWaIPg7A95d06Vso54rp2fJU8pY/eMGv2az94kcMMbS3XZrbhFkUm0 Vw2I4WKWfM46jsXvzxoxKX1AHMG8KR0= Date: Tue, 17 Oct 2023 12:46:36 +0200 From: Pavel Machek To: Paolo Bonzini Cc: Mikulas Patocka , "Kirill A. Shutemov" , Andrew Morton , Mel Gorman , Vlastimil Babka , David Hildenbrand , quic_jhugo@quicinc.com, snitzer@kernel.org, dm , linux-mm@kvack.org, linux-arch@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 00/10] Fix confusion around MAX_ORDER Message-ID: References: <20230315113133.11326-1-kirill.shutemov@linux.intel.com> <3c25ec6f-cd33-9445-a76f-6ec2c30755f5@redhat.com> <86e7f97a-ac6b-873d-93b2-1121a464989a@redhat.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="U9ipWO248TbRr+D3" Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, 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 agentk.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Tue, 17 Oct 2023 03:46:48 -0700 (PDT) --U9ipWO248TbRr+D3 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu 2023-09-28 18:57:18, Paolo Bonzini wrote: > On 9/28/23 09:50, Mikulas Patocka wrote: > > > > Fix the bugs and then change the definition of MAX_ORDER to be > > > > inclusive: the range of orders user can ask from buddy allocator is > > > > 0..MAX_ORDER now. > > I think that exclusive MAX_ORDER is more intuitive in the C language - > > i.e. if you write "for (i =3D 0; i < MAX_ORDER; i++)", you are supposed= to > > loop over all allowed values. If you declare an array "void > > *array[MAX_ORDER];" you are supposed to hold a value for each allowed > > order. > >=20 > > Pascal has for loops and array dimensions with inclusive ranges - and it > > is more prone to off-by-one errors. >=20 > I agree it's somewhat confusing either way but the ship has sailed, the > patch has been included in Linux for several months. Just make sure people don't backport it to stable. Fixes: (the commit that causes the semantic change) should do the trick. BR, Pavel --=20 People of Russia, stop Putin before his war on Ukraine escalates. --U9ipWO248TbRr+D3 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iF0EABECAB0WIQRPfPO7r0eAhk010v0w5/Bqldv68gUCZS5mDAAKCRAw5/Bqldv6 8tIGAJsFJix/mB5VZ3yp+Ypy6TLK4hgW0QCfcfJ3sDGET1Vosz3XWgzgTqljj6A= =mKaU -----END PGP SIGNATURE----- --U9ipWO248TbRr+D3--