From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 541D8C4345F for ; Mon, 15 Apr 2024 11:14:18 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id AA4C76B0083; Mon, 15 Apr 2024 07:14:17 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id A55536B0085; Mon, 15 Apr 2024 07:14:17 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 91BFB6B0087; Mon, 15 Apr 2024 07:14:17 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id 7325C6B0083 for ; Mon, 15 Apr 2024 07:14:17 -0400 (EDT) Received: from smtpin29.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id 36F18160550 for ; Mon, 15 Apr 2024 11:14:17 +0000 (UTC) X-FDA: 82011507354.29.3982B2E Received: from mail-ua1-f51.google.com (mail-ua1-f51.google.com [209.85.222.51]) by imf02.hostedemail.com (Postfix) with ESMTP id 6861C8000C for ; Mon, 15 Apr 2024 11:14:15 +0000 (UTC) Authentication-Results: imf02.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=GcxatCNC; spf=pass (imf02.hostedemail.com: domain of 21cnbao@gmail.com designates 209.85.222.51 as permitted sender) smtp.mailfrom=21cnbao@gmail.com; dmarc=pass (policy=none) header.from=gmail.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1713179655; h=from:from:sender: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:dkim-signature; bh=J8ZyzjEX1AaXJVzie93/e+FaGPHZRYE8RJ2TizcBW14=; b=oHodO0SvBq/UMDEiDZK91+z5QnmvJobL2RTjtA4uXYsk5w7nN+JxKpqOhjShE+MUBzCWN6 LUQyE8dGagzW7viuZ4nGAqJ9LOPwWDXVN3Sps/jgOhCoMfZ0m9ICsk/4xQbYy5LvOMbbCy eJQnrBwpXwFNrNadEZ/ccV0hugtX9rM= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1713179655; a=rsa-sha256; cv=none; b=zubt/FtlZl8lKHU0O2ZvqH2Dolq8xlTKnonj6w/W4tPi1C5usHxrV0KJbSC3cLPOPSY/lK uE8ktb7ayJB1FQN0hfGT76qjwrA+6nU/XqTrwzbN5YpCUr96jBIAMXbSOGk245wftwelv6 K5mTXs60BQm6Gvq9WJCYJG0KJk3lzoQ= ARC-Authentication-Results: i=1; imf02.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=GcxatCNC; spf=pass (imf02.hostedemail.com: domain of 21cnbao@gmail.com designates 209.85.222.51 as permitted sender) smtp.mailfrom=21cnbao@gmail.com; dmarc=pass (policy=none) header.from=gmail.com Received: by mail-ua1-f51.google.com with SMTP id a1e0cc1a2514c-7e618c51802so939632241.0 for ; Mon, 15 Apr 2024 04:14:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1713179654; x=1713784454; darn=kvack.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=J8ZyzjEX1AaXJVzie93/e+FaGPHZRYE8RJ2TizcBW14=; b=GcxatCNCMi55HfjivzopD4WCH/H3lsQcZFablmZtOdrMzRiawFilKZWiAq75+uC65y Dp9yZQp+3tWiiECsE5PcNJ0PdWZAywqZKpK1eWFZsPTzAfDsNU0HDOzZQcQnx5Kgc1BG UEXTO7BOD/gQGP4N0KlxjGZaLCQF05vmE7exC290o5ZUKv0OH4sAGx5OC1TpU0+vMQCA 9oLLC3JaqzCdbGBpHIb67uNQesOpNan0Iw+l9AjnRY1aI8QeQBSSn+W7M3QLW1OmYwVf BNH741jsB7K7BTfV7vdH1Bhxqeig3AA5cAnrdnLpA2dBuwDmbeRIFC2Dn6I18U9Vycir isFA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713179654; x=1713784454; 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=J8ZyzjEX1AaXJVzie93/e+FaGPHZRYE8RJ2TizcBW14=; b=afGfY9knnN6As9bOG3oEhMCyOXfZBf5ODN9LVQng8DkQ6/QnFafXDoyAZa9RwAsXzL BFGQfKd+xyUcbyVXbSFQMAKukBmhhYLFMuF91fluVL9CMc4mRJe4KcTIphb87zP+9nBL zKbZtI6co0NgV60J7PwD/U2E4kRwwj3k9LQSms2rrHsekpQDBNiToYJEnA+HdGLfRuNL ETI9T8w0LJdwBu9s9xbTreulG9lCliz/L2ly5N0Y+LFuNn0RhjC+23AiQHnQm6kbUV0o 1zAVpK4BwlcMMgrLiTABWLAE35zWuRf8lE1j/8xyIVnrS8BYcsM4Q651iPtnZcanjvjW WKHQ== X-Forwarded-Encrypted: i=1; AJvYcCX7MQ03Q+SGoZKEAikmYkCc30PvT9F9h3NbwIEk6iAqhOwcuTRC0rzg883urn125gZaaNRTlnMxvXK/J3iZG9e4Tcg= X-Gm-Message-State: AOJu0Yx5lSbF7ogUfE4qtZh/CSfKUIkBZGjzY8983dbJpSmg7e1wmO7y OSzDPJZKAtieXJjSHxZHa2B3aEw71OgqKTuVBkiyfFxpQyxdrh8x61BW3dLJrupEiMXyX2wmPuo +9Nf4o7lSSjm0B5tzaa7wrWlidmQ= X-Google-Smtp-Source: AGHT+IE2NqvFbMt7ZgPMhgXc5ekBFNvmxKy5b144soFUJAEbOC0wK1O9vrwSz3VN8TbAUSslBQit456aHNCuvP67a/k= X-Received: by 2002:a05:6122:209e:b0:4cd:b718:4b08 with SMTP id i30-20020a056122209e00b004cdb7184b08mr6617199vkd.11.1713179654517; Mon, 15 Apr 2024 04:14:14 -0700 (PDT) MIME-Version: 1.0 References: <20240415081220.3246839-1-wangkefeng.wang@huawei.com> <54623c8c-a94f-4f88-bf53-5f92c634f78a@huawei.com> <3b931621-7cd1-4df8-9070-535ecaee970e@redhat.com> In-Reply-To: <3b931621-7cd1-4df8-9070-535ecaee970e@redhat.com> From: Barry Song <21cnbao@gmail.com> Date: Mon, 15 Apr 2024 19:14:01 +0800 Message-ID: Subject: Re: [PATCH rfc 0/3] mm: allow more high-order pages stored on PCP lists To: David Hildenbrand Cc: Kefeng Wang , Andrew Morton , Huang Ying , Mel Gorman , Ryan Roberts , Barry Song , Vlastimil Babka , Zi Yan , "Matthew Wilcox (Oracle)" , Jonathan Corbet , Yang Shi , Yu Zhao , linux-mm@kvack.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Rspamd-Queue-Id: 6861C8000C X-Rspam-User: X-Rspamd-Server: rspam11 X-Stat-Signature: car7p37dkpyaff49n8rofjxepms7gndi X-HE-Tag: 1713179655-259319 X-HE-Meta: U2FsdGVkX1+1+GHUfeIT9rNnT8DNcKNV4kuzOHATKbHlqQHWYw+RdaLkN4+0k2PBxLM4pD3d8eFztaCzEheO/NDRR074aT1+oJ7C7EYr/lE/O5wa9HvUan/LeM1HSFEUyFCzmRI76KBlN3m8Mn2XG9jsXtqQ+5Kf/hIqVlZeBnuIcEhp8ZZQ0g9EBoQ95ML/xu/YVBGVNQE/hYhkbEckS8GWlI01ZbtqdLtepTrBOoxfiE5Pzidj1+85Zpm+HdVpNlm7I5aHyFylX0f3KzvQw1Zv+o/SkjeUGgJy+gT0ZZC7lTeSe8UGVuUUOYgOYtCpqquyn+UB5gy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ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: On Mon, Apr 15, 2024 at 6:52=E2=80=AFPM David Hildenbrand wrote: > > On 15.04.24 10:59, Kefeng Wang wrote: > > > > > > On 2024/4/15 16:18, Barry Song wrote: > >> On Mon, Apr 15, 2024 at 8:12=E2=80=AFPM Kefeng Wang wrote: > >>> > >>> Both the file pages and anonymous pages support large folio, high-ord= er > >>> pages except PMD_ORDER will also be allocated frequently which could > >>> increase the zone lock contention, allow high-order pages on pcp list= s > >>> could reduce the big zone lock contention, but as commit 44042b449872 > >>> ("mm/page_alloc: allow high-order pages to be stored on the per-cpu l= ists") > >>> pointed, it may not win in all the scenes, add a new control sysfs to > >>> enable or disable specified high-order pages stored on PCP lists, the= order > >>> (PAGE_ALLOC_COSTLY_ORDER, PMD_ORDER) won't be stored on PCP list by d= efault. > >> > >> This is precisely something Baolin and I have discussed and intended > >> to implement[1], > >> but unfortunately, we haven't had the time to do so. > > > > Indeed, same thing. Recently, we are working on unixbench/lmbench > > optimization, I tested Multi-size THP for anonymous memory by hard-cord > > PAGE_ALLOC_COSTLY_ORDER from 3 to 4[1], it shows some improvement but > > not for all cases and not very stable, so re-implemented it by accordin= g > > to the user requirement and enable it dynamically. > > I'm wondering, though, if this is really a suitable candidate for a > sysctl toggle. Can anybody really come up with an educated guess for > these values? > > Especially reading "Benchmarks Score shows a little improvoment(0.28%)" > and "it may not win in all the scenes", to me it mostly sounds like > "minimal impact" -- so who cares? Considering the original goal of employing PCP to alleviate page allocation lock contention, and now that we have configured mTHP, for instance, to 64KiB, it's possible that 64KiB could become the most common page allocatio= n size just like order0. We should expect to see similar improvements as a re= sult. I'm questioning whether shell8 is the suitable benchmark for this situation. A mere 0.28% performance enhancement might not be substantial to pique interest. Shouldn't we have numerous threads allocating and freeing in parallel to tr= uly gauge the benefits of PCP? > > How much is the cost vs. benefit of just having one sane system > configuration? > > -- > Cheers, > > David / dhildenb >