Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp2241026rwb; Mon, 19 Sep 2022 01:50:11 -0700 (PDT) X-Google-Smtp-Source: AMsMyM71wZibpACpHOw65e8TI5t5S5ceqlEdPCYlLfVvLCwrxK2SLp0QLXKogpzou350EcmDin0/ X-Received: by 2002:a17:907:2d0f:b0:780:2170:e079 with SMTP id gs15-20020a1709072d0f00b007802170e079mr12551577ejc.185.1663577411248; Mon, 19 Sep 2022 01:50:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1663577411; cv=none; d=google.com; s=arc-20160816; b=byFdOOhTivf5o5PgJgfDAZU/Em6swKJoBwx2jLvqB1DtPsyZpcHXgbFaUHc0a3AQQf vJOqJ+Y3Hrn1Aeg0PGGVSG07vDrLxDZoHajKmDugXsYu1DN17Pz22faLLnEbmhAY8nmW hFvzPxbj5s9Y8s/6ckGeo9kUjyrQWsbpV2rDaMKlCVjR3S3m6yrE+G/Wl5sF34uZ2DxW yw0Ry67lWfAOTBvnmWKvqrefQ7l22Ygd0Rh7++HUAlUIr+vE1704VPewoI4Hi/VqU77l y9Hh74PkO6FI+ay2aeyOWGs6pdqMDNYfXY4OCdXUw2Cauvvs2YS2uwDEshraijtJSrOo 4zqg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:subject :organization:from:references:to:content-language:user-agent :mime-version:date:message-id:dkim-signature; bh=h/1dK0PxjoGznFpiAoqtIHG4VWSzhz2ih+XQXjO5ifg=; b=xSglMH718acnbII2Zd/j/8fXAKShaF1P+gVOV1j1/cH8eHt6hsNjZBL696lKdQjJp7 ZPjO14iHyoCaqr2d70jx7+HWW1u2+u1RXowZzyiDg5AtdI/5MGg6rRqcFAwmFppt+wkS gyPzJ9jAGvGRDJeiD5yBvVxyYD86q/eFJBwYkknwKttRivba2l14RlSRBX29H2s3KqTy 7fRhX+obxD3+52V7N0m2wAhsLO917BUgIDy2UC8gzEyRoQ4pDaGgI7OJ+Vv9qVROk1Lo l0zZ3zAViKVzW005BQOyFfvMJFtVKchwiFyVKgnCfOSyv6y+n5sIpI2uGsC4opvsHSM9 Q2rw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=JtKYF1N9; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id hz3-20020a1709072ce300b00780636a4a58si11486733ejc.626.2022.09.19.01.49.45; Mon, 19 Sep 2022 01:50:11 -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=@redhat.com header.s=mimecast20190719 header.b=JtKYF1N9; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230003AbiISIiy (ORCPT + 99 others); Mon, 19 Sep 2022 04:38:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58846 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229997AbiISIiw (ORCPT ); Mon, 19 Sep 2022 04:38:52 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1B48115A0A for ; Mon, 19 Sep 2022 01:38:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1663576731; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=h/1dK0PxjoGznFpiAoqtIHG4VWSzhz2ih+XQXjO5ifg=; b=JtKYF1N9hVJ/qaUW9Fsr4ELAWFxHo4HVcd93Wkn/C62UEKhaA0Mhtq2/GtQ3MTFCEMD+eH G5od157Kf3fOwoWoiv/WzWh159KecF/7hlNVKCdyjhPKMWZrTQauAfJSC8jwTMs3Le4lZj A0ulKHO4az1CDqcs6JEDBjvmRGNrg2w= Received: from mail-wr1-f70.google.com (mail-wr1-f70.google.com [209.85.221.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-495-7al0CRBcN4CKGc-fKMR1lQ-1; Mon, 19 Sep 2022 04:38:49 -0400 X-MC-Unique: 7al0CRBcN4CKGc-fKMR1lQ-1 Received: by mail-wr1-f70.google.com with SMTP id d9-20020adfa349000000b0022ad6fb2845so1298403wrb.17 for ; Mon, 19 Sep 2022 01:38:49 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:subject:organization:from :references:to:content-language:user-agent:mime-version:date :message-id:x-gm-message-state:from:to:cc:subject:date; bh=h/1dK0PxjoGznFpiAoqtIHG4VWSzhz2ih+XQXjO5ifg=; b=EQWibJxIkoyq5Fkrl7+4uYg5YBFKsGSDno/yTGlbUDod8cbOWqEcssHkHimDWmJ899 Gjnqpf4RqS1uNiauyXX91uN0NuA4YN4rVZ9Geqb6wW/sOb6tL9HLQqkSq4JwR3rxh85Q kCz07hA/JikQK5SJfrXETWXCot01p9Ubpjx64ZqRdDPPsRNsRUMpU0oZ5MQYbzVGlnvD 6gewpzjVjGICyWPSFtf6yIxKQjC8XRHNq9tKV566M/Ek1rAi+fUjwEm85DScShpz+5qL n8BzN4H+fd1NzoPHgrdJfiHUVlXpimrvhcK4gdXNjAaPwcaXotWSs+rcbDH+u1897kIt EXdA== X-Gm-Message-State: ACrzQf3V2gtP18+7aHkql7/saeszALXLY93jLOibkVvcmYdbavy35wkf 3vHnWQZEW8MxKRANyRTWwqefHeQkB0HGVoqV8nKkxDnGY5SpQYLHiiDNOxSik7zWhEaVMiyRlRt I5/nUsG1rtj2OXjh6sik3Qg8k X-Received: by 2002:a05:600c:4841:b0:3b4:76f0:99f with SMTP id j1-20020a05600c484100b003b476f0099fmr12138978wmo.85.1663576728601; Mon, 19 Sep 2022 01:38:48 -0700 (PDT) X-Received: by 2002:a05:600c:4841:b0:3b4:76f0:99f with SMTP id j1-20020a05600c484100b003b476f0099fmr12138972wmo.85.1663576728388; Mon, 19 Sep 2022 01:38:48 -0700 (PDT) Received: from ?IPV6:2003:cb:c703:c100:c136:f914:345f:f5f3? (p200300cbc703c100c136f914345ff5f3.dip0.t-ipconnect.de. [2003:cb:c703:c100:c136:f914:345f:f5f3]) by smtp.gmail.com with ESMTPSA id c11-20020a05600c0a4b00b003b47e8a5d22sm14764593wmq.23.2022.09.19.01.38.47 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 19 Sep 2022 01:38:47 -0700 (PDT) Message-ID: <826cd775-14d2-12ae-2e96-cf0766aa1502@redhat.com> Date: Mon, 19 Sep 2022 10:38:47 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.2.1 Content-Language: en-US To: Michael Nazzareno Trimarchi , Mike Rapoport , LKML , Andrew Morton References: From: David Hildenbrand Organization: Red Hat Subject: Re: Correlation CMA size and FORCE_MAX_ZONEORDER In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-3.8 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A, RCVD_IN_DNSWL_LOW,SPF_HELO_NONE,SPF_NONE autolearn=ham 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 15.09.22 23:36, Michael Nazzareno Trimarchi wrote: > Hi all Hi, > > Working on a small device with 128MB of memory and using imx_v6_v7 > defconfig I found that CMA_SIZE_MBYTES, CMA_SIZE_PERCENTAGE > are not respected. The calculation done does not allow the requested > size. I think that this should be somehow documented and described but > I did not > find the documentation. Does it work this way? > > With CMA_SIZE of 8MB I need to have FORCE_MAX_ZONEORDER=12 if I have > the default FORCE_MAX_ZONEORDER=14 the min size is 32Mb The underlying constraint is that CMA regions require a certain minimum alignment+size. They cannot be arbitrarily in size. CMA_MIN_ALIGNMENT_BYTES expresses that, and corresponds in upstream kernels to the size of a single pageblock. In previous kernels, it used to be the size of the largest buddy allocation granularity (derived from MAX_ORDER, derived from FORCE_MAX_ZONEORDER). On upstream kernels, the FORCE_MAX_ZONEORDER constraint should no longer apply. On most archs, the minimum alignment+size should be 2 MiB (x86-64, aarch64 with 4k base pages) -- the size of a single pageblock. So far the theory. Are you still running into this limitation on upstream kernels? -- Thanks, David / dhildenb