Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp7941561rwr; Wed, 10 May 2023 15:12:53 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7dojXtK4ik6UiEjZRcUePZDXSheMHTl4XuirK6WU5Qy+iBiJJW7eSeSIsiF1zwJM38wPMy X-Received: by 2002:a17:902:ef96:b0:1aa:ce4d:c77d with SMTP id iz22-20020a170902ef9600b001aace4dc77dmr18242631plb.24.1683756773253; Wed, 10 May 2023 15:12:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683756773; cv=none; d=google.com; s=arc-20160816; b=Bi+0QUhA/6XPeyTKHYJx25X1vwC5ZU2X4VrgVPZ8Dfis/hdGyEA75pMnFWWm7CeKW3 fOa0e2l4uASlgOFZn6qZqFLgwUcnaeSUmst9jqYdJe4mdszhGaJHaxxbdT8iVuIfu71x QUSiW1r3cwkkM5A8BV1UVMm5Rj6MyR0o0E09R2on8jrZmSKKWABaUr2asm7uWOYj3yfE u1NRP8oyVY4chyloPldrA4+qp0jLO2ZeElUvzYU4vkf0MLhMEPPUvOCT9VuPJgZVOnzC UENAKVLkEQ681z6d4CIZHFFgjcjcL571+qkhJISzqX3x3ye4diU1dCxlmSSciO7+7w9B LcXA== 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:dkim-signature:date; bh=WrIQPQnkmZGURp0Bxb/q8NWjaJP+SM0tcC5NbyW/agE=; b=g9y4ZYqCxcZs5L5kNUI2D93m7oJcAT5k7RcMESUfPxpo7AqQ/qNEd2hSKl2Rvp1GZj PNG2oLb8owD/q23vxjlxFxInKHIUbqkwasN6cwmxO3eXnqwiGu44w5RO4vyzqi8V6t6i r8UmVv1h2Zhx5Mgj1YME4O5OLpawGj1XJIAJIUjlOopPDfk7gCwcGo2P3nYz/9aCx3rB MYG4U1nDAJuEp01w3RupCnwbQisaWUbA5Y9ulPUt1PEtXDauloYQuWHcwMse6EKNe3ob eYs3/8o9PM7jgso9VgQnhgdm4WM0fnSiNl30to1IdxjDBFIjhyySFywQo/7/hg3AmLPx H+Sw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b="syYion/p"; 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=linux.dev Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h14-20020a170902f54e00b001aaecb74f86si5242506plf.569.2023.05.10.15.12.41; Wed, 10 May 2023 15:12:53 -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.dev header.s=key1 header.b="syYion/p"; 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=linux.dev Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236313AbjEJWJP (ORCPT + 99 others); Wed, 10 May 2023 18:09:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57902 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236570AbjEJWJA (ORCPT ); Wed, 10 May 2023 18:09:00 -0400 Received: from out-43.mta1.migadu.com (out-43.mta1.migadu.com [IPv6:2001:41d0:203:375::2b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 348998690 for ; Wed, 10 May 2023 15:08:32 -0700 (PDT) Date: Wed, 10 May 2023 15:08:10 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1683756506; 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=WrIQPQnkmZGURp0Bxb/q8NWjaJP+SM0tcC5NbyW/agE=; b=syYion/pf3iN5g6Erh/3IJtGMvtUP1OBfdD3Vp5MYVa4Lwh3Ievk83IcH0lqtCkDhM1UhN qHRIfMmS3RbokWDV5HvZmpwqnXrvohilj8m+uFX9+pcuE0VIwzX6rOM3WtEvscoATWoUJ8 XBuQafjM5RUyAeeQUbrpb6ERXDxKJAE= X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Roman Gushchin To: "zhaoyang.huang" Cc: Andrew Morton , Roman Gushchin , Minchan Kim , Joonsoo Kim , linux-mm@kvack.org, linux-kernel@vger.kernel.org, Zhaoyang Huang , ke.wang@unisoc.com Subject: Re: [PATCHv4] mm: optimization on page allocation when CMA enabled Message-ID: References: <1683685251-2059-1-git-send-email-zhaoyang.huang@unisoc.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1683685251-2059-1-git-send-email-zhaoyang.huang@unisoc.com> X-Migadu-Flow: FLOW_OUT X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED 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 Wed, May 10, 2023 at 10:20:51AM +0800, zhaoyang.huang wrote: > From: Zhaoyang Huang > > Let us look at the series of scenarios below with WMARK_LOW=25MB,WMARK_MIN=5MB > (managed pages 1.9GB). We can know that current 'fixed 1/2 ratio' start to use > CMA since C which actually has caused U&R lower than WMARK_LOW (this should be > deemed as against current memory policy, that is, UNMOVABLE & RECLAIMABLE should > either stay around WATERMARK_LOW when no allocation or do reclaim via entering > slowpath) > > -- Free_pages > | > | > -- WMARK_LOW > | > -- Free_CMA > | > | > -- > > Free_CMA/Free_pages(MB) A(12/30) B(12/25) C(12/20) > fixed 1/2 ratio N N Y > this commit Y Y Y > > Signed-off-by: Zhaoyang Huang I'm mostly fine with the code. The commit message is still very confusing to me, not sure I understand what exactly this table means. And you still use "U&R". Also I'm a bit concerned about potential performance implications. Would be great to provide some benchmarks or some data. Probably it's ok because of we have pcp caches on top, but I'm not 100% sure. Thanks!