Received: by 2002:a05:7412:da14:b0:e2:908c:2ebd with SMTP id fe20csp2232885rdb; Mon, 9 Oct 2023 18:31:54 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGyNCduMwYrHESPuGEUJrDWpSYdRKpySLmx/CnZm0Nk/ZOZLDykE8JKJT+Z6ywX/zGHBxa/ X-Received: by 2002:a05:6808:1310:b0:3a9:e8e2:5799 with SMTP id y16-20020a056808131000b003a9e8e25799mr21941396oiv.14.1696901514416; Mon, 09 Oct 2023 18:31:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696901514; cv=none; d=google.com; s=arc-20160816; b=Cc9zq7BNuU7P/9+NhDCSWAwGyYJnS/rGjnjBu3T5y80A3/q3J4Rj3TSaper7Y7bpu6 u1L49GwCOvz33TPMd92N/XWGD7SFHVb9vKzPyX8sexZ1KtvFIh4CtaWCWaN5c7HJ+VGQ qmrBPHd++7f2dhJABq4RcWo4laKargnxHmqcbIogFG0vEzp07oh+gBBw5T4UovTUL6vr qbnTVpRUUzd79DYcuTDN73I60bYn0Lh4r/z85XIf47nEvl8M3ZqveT7oaSaN6mpjLTzw zQXZveMd1als4nHE5l9hdZ5UOu4edppJZUGAWwXKLAB5wlyxzYj7gzwmuK2zTTAmyDmn vi6g== 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=Ho1/AhNyD0qYiEmVEK/IfiNfgDoSn0wjA0JY40hhrfo=; fh=WaiRi07zoOxjxpJXXJ3lMb8QbmEGFjvFzmWJgHiSl9c=; b=jTxYc/DeFZRn9y6igqHPs6racIBjlKlKalXhG/1A2g0smEMTHNvttDedzZW4nysmnO y7wvnFGZHrtw1xIjBdYaZOK+50mINcKwu5M2Q+iNgGN3qBP/7Q8lTI78gYGsv03w+hKB rR13gsDr7Zyd982ecCma+rHeVwGO/MZ/xRKnlCNk/ilisNThyPWGhbLD4Qu6MQnytlZ4 Z7heThdUXTSlenf1YK+AHKpCkW38eMUNyYlfxOQ4bnO1gvNITccqsrj9AJUhYOrXdM9w A4OAIyI0Qe0tZQGmnM+ch5qxbTCOPeaH1QOvLNYz1pP+A36ZShbZ/OaBZsyqjACscZMR Hgjg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=eRylKYE4; 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=NONE dis=NONE) header.from=linux.dev Return-Path: Received: from snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id y18-20020a63b512000000b005897813624fsi9685555pge.476.2023.10.09.18.31.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Oct 2023 18:31:54 -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=@linux.dev header.s=key1 header.b=eRylKYE4; 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=NONE dis=NONE) header.from=linux.dev Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 996A380FDDE0; Mon, 9 Oct 2023 18:31:53 -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 S1379294AbjJJBbw (ORCPT + 99 others); Mon, 9 Oct 2023 21:31:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58348 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1379278AbjJJBbv (ORCPT ); Mon, 9 Oct 2023 21:31:51 -0400 Received: from out-203.mta1.migadu.com (out-203.mta1.migadu.com [95.215.58.203]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E329191 for ; Mon, 9 Oct 2023 18:31:49 -0700 (PDT) Date: Mon, 9 Oct 2023 18:31:43 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1696901508; 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=Ho1/AhNyD0qYiEmVEK/IfiNfgDoSn0wjA0JY40hhrfo=; b=eRylKYE4l/CKWymVpIyaPDUoBL9vKiqAT0GEXztgMI21lINvE61Io6wKq3XH8UO0uvw7Kb zbCMF2VYFQEJzkDE36IwgbqO9pdqe3JFypmJ8s46vInBChDcv2+24kT6ka2+P/W9iXjMNB /MhETnefBKNjqKZnOhZAD6hR6oLVAjI= X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Roman Gushchin To: Andrew Morton Cc: Zhaoyang Huang , "zhaoyang.huang" , Roman Gushchin , Minchan Kim , Joonsoo Kim , linux-mm@kvack.org, linux-kernel@vger.kernel.org, ke.wang@unisoc.com Subject: Re: [PATCHv5] mm: optimization on page allocation when CMA enabled Message-ID: References: <1683782550-25799-1-git-send-email-zhaoyang.huang@unisoc.com> <20231006141750.5423083520f74bc0746fd249@linux-foundation.org> <20231009171415.cfc26b45c2f9f4489afe16c2@linux-foundation.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231009171415.cfc26b45c2f9f4489afe16c2@linux-foundation.org> 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,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_NONE,SPF_PASS,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 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:31:53 -0700 (PDT) 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. On the positive side I believe that the patch is solving a real problem.