Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp2314745rwb; Mon, 19 Sep 2022 03:18:03 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5RFzYVTL9cxcKqI7TqVUq0CTq12FzfeqYHWxmbJ0dDjtdnT81AwM6PiZCnWEnPZ2wOHJfs X-Received: by 2002:a17:902:b907:b0:178:9d11:c978 with SMTP id bf7-20020a170902b90700b001789d11c978mr5400784plb.90.1663582682908; Mon, 19 Sep 2022 03:18:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1663582682; cv=none; d=google.com; s=arc-20160816; b=aJ+1lXUjZucs5f/UF2OJktve13LlqgW1gu/uzZgSL+NsAm04+mbQOQAUP0vaYxlrEH FMB2Pf+PHdm75otAOUjh1RWNjoSNwWITdE8nXVT5BbVz29H6KggWcASlNnviDZ0A9cuK tZ284pvSukaNAmJ0Uix7FGgndDIavA0b9y865UqUhIsyKu3ogHRyGHTMBlHeXgT4eK5C 8UABjAssgGxMcg3e80b5/u28Kwc3eSk8naUNdv22zMw3zneBUe7fgHe9umPo6QSCHOgL xbf291oTjyrx3cJaCIUqByOcOOu0fdKh1fWx4MDPMUUI6sHP0EREP95G3WL9ZejKFnuK LB5g== 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 :organization:from:references:cc:to:content-language:subject :user-agent:mime-version:date:message-id:dkim-signature; bh=oE4JqwfpkTz6M2Oz21kLEomloGPhwfNZ/IsoD6mNtaA=; b=UztDJ22z7a95CqxpYW8PYaq0+d5cKxgGat7HF26I7wM5tHoU+XmsfL5bFtaQsVjxWw k7eMfNJWBzfJukQvdRnCH5KGX5mpnC5ig4HFWVRh+h2L8W+V2H/LRCSr2cRwHHR5tUYZ Z/5c9mTOdf5UcGb45ehT5O8akD4AAZ3eqT5y/ChwKijuWYRGA75V6mHsDtDVKEUKXf3c O8oZWyfPdPQQJCcOW/W9KolQ30+aiLEBSwS8epuRJExtYbeHH5CBs/rrZs9MBhcdvKJh jvUseVIQRuumPBA27aKJIc9wDrari8tON6fYN3SRB0E2v4Jw0KYbvWv6Ra6ZSG2Av+Ba ykLA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=Rsvx8Iz+; 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 x40-20020a056a0018a800b00542258e82a0si16640273pfh.68.2022.09.19.03.17.50; Mon, 19 Sep 2022 03:18:02 -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=Rsvx8Iz+; 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 S229574AbiISJbS (ORCPT + 99 others); Mon, 19 Sep 2022 05:31:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46470 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229926AbiISJbP (ORCPT ); Mon, 19 Sep 2022 05:31:15 -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 292E61FCC4 for ; Mon, 19 Sep 2022 02:31:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1663579872; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=oE4JqwfpkTz6M2Oz21kLEomloGPhwfNZ/IsoD6mNtaA=; b=Rsvx8Iz+qQj3oxMQpOvTTEKUEglCViS/+B9G4X4NBcRuplJ+Ijrm6u/KaWwZukUCbBKw3j jBFFsKvhEWlrju/ERNoMvvNAfP5PusVeQTgYj9JcH1oR/gUAWg98s9P1N9O7nbs04Iy/iI QvbG17mayAlMQEo7vfbmX+qcfflIZyM= Received: from mail-wm1-f72.google.com (mail-wm1-f72.google.com [209.85.128.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-249-FHuOvy5BPmm6nvmKE9jPHQ-1; Mon, 19 Sep 2022 05:31:10 -0400 X-MC-Unique: FHuOvy5BPmm6nvmKE9jPHQ-1 Received: by mail-wm1-f72.google.com with SMTP id c188-20020a1c35c5000000b003b2dee5fb58so14943930wma.5 for ; Mon, 19 Sep 2022 02:31:10 -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:organization:from:references :cc:to:content-language:subject:user-agent:mime-version:date :message-id:x-gm-message-state:from:to:cc:subject:date; bh=oE4JqwfpkTz6M2Oz21kLEomloGPhwfNZ/IsoD6mNtaA=; b=l7DY91geo3icsYxXCcjo7ba+8HRYYAn0lpMqjDmrEhVxkBNs0usLA2IuqLIvyZqXD+ EJfmizqMJtj4EvZ3ZhDx6XsNETL5jFhrMjX7EbrZOelIpHoT7rPWqHzR6mBfPipxWpWM 5J5PP5HpWunUytUMPd1EdSeB7sAkyjTjNCeHwCbs7/U41IxzsnadQDazGOroiQzlV8+z 8ER1eYQe/+WhglHKVAT6MSqqzvEeqzHXZUVqPaknwEhedwH2CvFSfI5kEV2okT3GxcVH q2jhl5EFztTPkMTBlF+knbtK8V3UajW151MmV5an82iFj0s7RjtQT/J00wgaWo7aRTfk k2bg== X-Gm-Message-State: ACrzQf1HHCb29746VmAHDtFBknJcRffPWtXfGILxATv6IHhqrjgIBVS0 HJh8pBRU/CUF2mJw8jZa0s/HjWmV2t3xyexanE3sCg2Kuw2Ckb9ORMMIaUoO2mxB+jj8ytgAgO0 hg+GcjFODDk/m2jtwi1bYliei X-Received: by 2002:a05:600c:524f:b0:3b4:7cfa:3ca3 with SMTP id fc15-20020a05600c524f00b003b47cfa3ca3mr11982347wmb.172.1663579869530; Mon, 19 Sep 2022 02:31:09 -0700 (PDT) X-Received: by 2002:a05:600c:524f:b0:3b4:7cfa:3ca3 with SMTP id fc15-20020a05600c524f00b003b47cfa3ca3mr11982336wmb.172.1663579869284; Mon, 19 Sep 2022 02:31:09 -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 m9-20020a056000008900b00228cbac7a25sm13073328wrx.64.2022.09.19.02.31.08 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 19 Sep 2022 02:31:08 -0700 (PDT) Message-ID: <4475783a-73c1-94f1-804e-507abeb84ab1@redhat.com> Date: Mon, 19 Sep 2022 11:31:07 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.2.1 Subject: Re: Correlation CMA size and FORCE_MAX_ZONEORDER Content-Language: en-US To: Michael Nazzareno Trimarchi Cc: Mike Rapoport , LKML , Andrew Morton References: <826cd775-14d2-12ae-2e96-cf0766aa1502@redhat.com> From: David Hildenbrand Organization: Red Hat 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 19.09.22 11:17, Michael Nazzareno Trimarchi wrote: > Hi David > > On Mon, Sep 19, 2022 at 10:38 AM David Hildenbrand wrote: >> >> 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? >> > > I can run 6-rc2 on my board. I test again but according to it, if I > put 4M as CMA in cma=4M in boot > parameters, the result is 32Mb of CMA. Apart of that seems that > process lime tiny membench can not even start > to mblock memory > The CMA alignemnt change went into v5.19. If "cma=4M" still gives you > 4M, can you post /proc/meminfo and the early console output? -- Thanks, David / dhildenb