Received: by 2002:a05:7412:da14:b0:e2:908c:2ebd with SMTP id fe20csp2236026rdb; Mon, 9 Oct 2023 18:43:02 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGVN4hCUl1khDiSf9ewgvXZobkVIkix+n4/T8d6avwZouLADrPLLblOn9XyeuhofEe7+w8O X-Received: by 2002:a05:6a21:998c:b0:161:76a4:4f79 with SMTP id ve12-20020a056a21998c00b0016176a44f79mr17809481pzb.23.1696902182294; Mon, 09 Oct 2023 18:43:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696902182; cv=none; d=google.com; s=arc-20160816; b=HAZEZW5qMA3/OXzPASxyclLO9HERxerS2yo4+H9rYp99HLKoO2J9xyQjBo74CeUEBl 8NF9inGAmh6MEngAU1Y88Tf967i6/RcsjZq1uHDc+kD4Nzjj0sFersh3JhzJeIhFP8mA nkXROkTudKCA5znFGh6W4x8X8t+WA94hvwVaKoiyXBbn+oLiECIZKR/JqEO0rTOuWhsd lM8FZLoVoeGg6oHkYvkcnWTn+pTzuXviCXuTTY3VMUYKbw1YuC0XM8y8V5l4S2HSOVS0 DKXQeuyFrabq/mr4LEk5qw07JpZsC1usYELb8GU9vH/iHiY1AxLTrbxySll0QmPUQOm9 8wlQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=8r8xsqUE1WfCL4pE6OYo22lswirb6FPZBD4Cqt+Avvc=; fh=OLvyapdqx+QserUuImu+MpTLbYNTVkAblRTUWFJSoBE=; b=p3PZQ7PHa1cDdt/TeJf4XjVSTsT/q0fDFma3ukTFGNGsgvzE1mmdkR5o0xd2Pt70hB SGi0L27TXwuZOrAKulQ/bNqNztUOtL/kCT7bcqaX2RUjp52Soi++9nJrJ7yPrNo8ph75 7Ri8cie6yB40lMWahX9iWckJT9v9Fu0o146l1fG7v6JaJEVbuYCOwOLlJAETDVS2c57e ifW/wii+NbGjAdt//6hZVIF1TAtuwQK09D2HGBAD0lr3wrHCRGt8ShWQzNViDHrjs9vo CibI0K2rBc5ccMtz/o7QdS4ULDU+e/aCwsGZuMa8FyeZy9vM0m4Hqc/6XFP06LAszUtV m0jg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=CDF1Bh7i; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id z17-20020a1709028f9100b001c77e00809csi8794547plo.453.2023.10.09.18.43.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Oct 2023 18:43:02 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=CDF1Bh7i; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 517BA80FDDED; Mon, 9 Oct 2023 18:43:01 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1379376AbjJJBmx (ORCPT + 99 others); Mon, 9 Oct 2023 21:42:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60818 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1379364AbjJJBmv (ORCPT ); Mon, 9 Oct 2023 21:42:51 -0400 Received: from mail-lf1-x136.google.com (mail-lf1-x136.google.com [IPv6:2a00:1450:4864:20::136]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0B5D99D for ; Mon, 9 Oct 2023 18:42:50 -0700 (PDT) Received: by mail-lf1-x136.google.com with SMTP id 2adb3069b0e04-504b84d59cbso6818262e87.3 for ; Mon, 09 Oct 2023 18:42:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1696902168; x=1697506968; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=8r8xsqUE1WfCL4pE6OYo22lswirb6FPZBD4Cqt+Avvc=; b=CDF1Bh7ip6AuzL3cd67XupnqG3EiLJG//Vj+gYJ7ujTVVwHk9QqmMS2shD8kQ61cU0 lCRPqKssiXzHvMp/HkgBH2wSutWs5YWO63nP0fcu8EVVlfaoE5WtOetlVUqTLqKdMYbI c2UQN+Q3H3RhZijk2zN02OFk61neepd9R35bXZ8nJUs50Ot+ZW1rrw3c49brvprm1WZx Cgo+SYhlhxad5/ctzzEBP/FN3sUUNMTJqQWVDO10q0b9A73c2ftZaYudiBkFwyo2VTln JumFVYwG8KsDFS4j45pZ3V2dco2fIGZ/D60yekOVAN+raFHGJPaYxV7lm3yECF7AxIMn IRbA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696902168; x=1697506968; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=8r8xsqUE1WfCL4pE6OYo22lswirb6FPZBD4Cqt+Avvc=; b=SnRyjTVklaJuUPJhlNywQ+hEghRQNjesD2KONnIqRr+rfTiAD0JzmBlJRGP60A377y vICFIAKrfdXwYA1F9JHCRN09K2WZCQwsc9b9aqCpc8TgzWJTuHSdKBVG4XGJCj2wHOHp vvUUEIhmyJI0c4EKKPfic4a7Tg7XyIwULi2kasZxnCVM9fAWfSvVk214441H/oudKTxD b9YOy0DzZvOp1X+JojWBfB3wJJMAtOHpbXjfEaTYz/3bmV0KGwbyAnq8PisA/wH4TgzZ IsObfXEwLT+B2vcNVLr2awyBpTktRq1gJgYnwdJYPkrZ0wLi4vS8s1bjpy18slNoas3q v7GA== X-Gm-Message-State: AOJu0YwBVnVvJACz9ylYCn9G6a9ElqZ9GmANJ/LMc+0viIc181D2D33Z 0wIcd6X/qcxvLN1Es5jMf2/zwJoJN63kpw5a6WY= X-Received: by 2002:a05:6512:3e20:b0:502:9fce:b6cc with SMTP id i32-20020a0565123e2000b005029fceb6ccmr19062741lfv.11.1696902168001; Mon, 09 Oct 2023 18:42:48 -0700 (PDT) MIME-Version: 1.0 References: <1683782550-25799-1-git-send-email-zhaoyang.huang@unisoc.com> <20231006141750.5423083520f74bc0746fd249@linux-foundation.org> <20231009171415.cfc26b45c2f9f4489afe16c2@linux-foundation.org> In-Reply-To: From: Zhaoyang Huang Date: Tue, 10 Oct 2023 09:42:36 +0800 Message-ID: Subject: Re: [PATCHv5] mm: optimization on page allocation when CMA enabled To: Roman Gushchin Cc: Andrew Morton , "zhaoyang.huang" , Roman Gushchin , Minchan Kim , Joonsoo Kim , linux-mm@kvack.org, linux-kernel@vger.kernel.org, ke.wang@unisoc.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS 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 X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Mon, 09 Oct 2023 18:43:01 -0700 (PDT) On Tue, Oct 10, 2023 at 9:31=E2=80=AFAM Roman Gushchin wrote: > > On Mon, Oct 09, 2023 at 05:14:15PM -0700, Andrew Morton wrote: > > On Sun, 8 Oct 2023 15:54:40 +0800 Zhaoyang Huang wrote: > > > > > > Roman previously asked > > > > > > > > : 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. > > > > > > > > Are you able to perform such testing and tell us the result? > > > I have applied this patch in a v5.4 based ANDROID system and got no > > > regression problem. Actually, this commit is aimed to have > > > alloc_pages(GFP_USER) use CMA instead of stealing U&R(could lead to > > > GFP_KERNEL fail) only when zone's free pages and free cma are around > > > WATERMARK_LOW/MIN which would NOT affect most scenarios. > > > > OK, thanks. > > > > Could the appropriate people please take a look at this? It has been > > in mm-unstable since May. > > I have 2 concerns: > 1) it's still hard to understand the commit message and comments, I can > only reverse-engineer it based on the code changes; > 2) performance concerns I expressed earlier are not addressed. Idk what's > a good benchmark for the page allocator, probably something i/o or > networking heavy. > ok, I will update the commit message > On the positive side I believe that the patch is solving a real problem.