Message ID | 20240804080107.21094-2-laoar.shao@gmail.com (mailing list archive) |
---|---|
State | New |
Headers | show
Return-Path: <owner-linux-mm@kvack.org> 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 4D01CC3DA7F for <linux-mm@archiver.kernel.org>; Sun, 4 Aug 2024 08:01:40 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id C10506B0098; Sun, 4 Aug 2024 04:01:39 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id BC02E6B00A0; Sun, 4 Aug 2024 04:01:39 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id A87CA6B00A1; Sun, 4 Aug 2024 04:01:39 -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 8CF396B0098 for <linux-mm@kvack.org>; Sun, 4 Aug 2024 04:01:39 -0400 (EDT) Received: from smtpin07.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id 14B21C186D for <linux-mm@kvack.org>; Sun, 4 Aug 2024 08:01:39 +0000 (UTC) X-FDA: 82413818718.07.B0A9D98 Received: from mail-pl1-f171.google.com (mail-pl1-f171.google.com [209.85.214.171]) by imf24.hostedemail.com (Postfix) with ESMTP id 2A5BE180002 for <linux-mm@kvack.org>; Sun, 4 Aug 2024 08:01:36 +0000 (UTC) Authentication-Results: imf24.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=i8iqR5DE; spf=pass (imf24.hostedemail.com: domain of laoar.shao@gmail.com designates 209.85.214.171 as permitted sender) smtp.mailfrom=laoar.shao@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=1722758467; 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-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=VuIgKurhfVuhaRadflHzHTLjU4+G8ZrUnfFV7pM3qek=; b=5Cv9FT4E52z5/CHFgWh3f1jd/r0nRXd1TJas+W+bGkzRl1WskleY0SXUmP9dtnACEWgYMz Xs69O8CyFO4p6oXFQF81eU9gOUcihUWqkEn4qaZ0gC2sYh1THE8tJvFKtOmmKAm12BrtKa jMtTzCurR4UZq4NthgRTdD6XW4R38PI= ARC-Authentication-Results: i=1; imf24.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=i8iqR5DE; spf=pass (imf24.hostedemail.com: domain of laoar.shao@gmail.com designates 209.85.214.171 as permitted sender) smtp.mailfrom=laoar.shao@gmail.com; dmarc=pass (policy=none) header.from=gmail.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1722758467; a=rsa-sha256; cv=none; b=IfU7GogVaJIGqc9Vc5hLpL9BD5uwgVn9+SFgjACjK19kLvZT1rRIv8vnoCOO46rig1M9WV MYV+XIOCE0DgTKkbe74kvu6xghOhcA3ZWQeV127/GFktboA6vW5BJzlDt9m8vZTrJcnN9I YHPJ0/nsEMixjnvRICKC2XRxWRBQacw= Received: by mail-pl1-f171.google.com with SMTP id d9443c01a7336-1fc566ac769so69138895ad.1 for <linux-mm@kvack.org>; Sun, 04 Aug 2024 01:01:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1722758496; x=1723363296; darn=kvack.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=VuIgKurhfVuhaRadflHzHTLjU4+G8ZrUnfFV7pM3qek=; b=i8iqR5DEqEMvr2ZLY2HmEoJrVKck1STH6A9GXD3n6VvutQIgBrZVmOXBy7lUXqCTw5 s3+kKahUuG1NuidNHpgko6a8wF+vFehlIma0b68F6S8BoOuQAhz7dGVqGBJW/JnWYHlU jkn+Hr2GZ/pFAIl7a0FqHz1a3O+dm4lFoTrmYFBAy1x2OiRLiW3wnorfxNHH9ybrzKD9 xp5biVqgsvR82U4SXNkORc+tUn2gBPs8pqYyp3iPw/MN+cuoQ0uMODPe3yEDC/HeFAOi GDLSAeP4JTdTt7OCMw3c9r5pJOgCfMIMFlpP2AbxKdgHbc7U6X0Bwg24JdIPPs/AhY8h yrvw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1722758496; x=1723363296; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=VuIgKurhfVuhaRadflHzHTLjU4+G8ZrUnfFV7pM3qek=; b=dG++MXgmoueefuovP5WbAEF1C2XgOhSxMMiOUnC3YWEzYCFl/s/BoUrbBRB5JQicoX J2eNbvaiYaCa6iBdm3BrgDwDa1xE2IS3UMv9CrJK3855RpZ1qhcAptzBgqwHlhmbKuPV V1ZXAI44EyzV/BtwyE1mCLwqp7JjKHZOMii/i9CNlFQEyucdgMzJn5ei7rfGjS+VKF2V 8JRLsg+0qaPgg7DAGXrfe3JdwDEOEsFHMIWr6N+AVaXEPMjGELBEU+p5AzYusfsBzaS9 eN1vCvQMv4wVFUPikD9XFh/GzLaVP3DmsTnntGEPFFkZdmsud0XM/n8mAxICjbTFVquo TQFw== X-Forwarded-Encrypted: i=1; AJvYcCWbijNvTkO2Pgtq5kZMiq8Jtm9EeDG7P+aOniRsPrpQwfPAWmx+wO3/ttCXYo7/EYYtaE4HmD32xg==@kvack.org X-Gm-Message-State: AOJu0YwDhgCJmPow0hAGPvURSuj5vDo17GEnjSW9BspFN+RcUJ/xWM57 qJHR5bB2FdH4+BHdeo3QBXDUFr7yyBNDYGpuGqfpvz4D6t0yuhtJ X-Google-Smtp-Source: AGHT+IETMCm9KlLGfOUvm2Wfa1A1NfpEge6tnm3wsEPeLEldIWCcv2jJJTQKZyOhauMLSQHb4RwIlQ== X-Received: by 2002:a17:903:41c9:b0:1fd:70f7:220d with SMTP id d9443c01a7336-1ff57421fd0mr86427315ad.40.1722758495817; Sun, 04 Aug 2024 01:01:35 -0700 (PDT) Received: from localhost.localdomain ([39.144.105.172]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-1ff61f3fc8asm39601295ad.231.2024.08.04.01.01.32 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sun, 04 Aug 2024 01:01:35 -0700 (PDT) From: Yafang Shao <laoar.shao@gmail.com> To: akpm@linux-foundation.org Cc: ying.huang@intel.com, mgorman@techsingularity.net, linux-mm@kvack.org, Yafang Shao <laoar.shao@gmail.com> Subject: [PATCH v3 1/3] mm/page_alloc: A minor fix to the calculation of pcp->free_count Date: Sun, 4 Aug 2024 16:01:05 +0800 Message-Id: <20240804080107.21094-2-laoar.shao@gmail.com> X-Mailer: git-send-email 2.30.1 (Apple Git-130) In-Reply-To: <20240804080107.21094-1-laoar.shao@gmail.com> References: <20240804080107.21094-1-laoar.shao@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Rspamd-Server: rspam03 X-Rspam-User: X-Rspamd-Queue-Id: 2A5BE180002 X-Stat-Signature: u93yi4gyh9mqmd6e31z11tq6iwcr174h X-HE-Tag: 1722758496-793229 X-HE-Meta: U2FsdGVkX1/+P5a9bgSQMK7DxJOvveKHLgZmVZX3BjQeDkybgDaQuXbwk6Ci3jwukksPvXhCKbiFQsDzBDThzdAPLYH4pEBKov+jab/zQ26itBc0XKdL3YBRW0ZULvm8cmQpaoIAXh5EKsL+7u8r1sucr4PeG9IBByXW6lv5Tt+0Xoa7MGxFrbK9Elv0iooXa0T55Mn38V3ag2juFfseM2d9/dNIk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j4EbFcdRyWtmj55T1O/V9JBOHo6+rJqsQceog/KLQ5FDsouCXw6IGX3gS26d8TZFrSvC+MnApb+iS7QZkH0a9Iwna1dLpOAL7BRjF83orRRzW3NlmMN1tFST87tZ+sV8hkuFxoYuX3+0F82HEDDAJ1RtyBzsFRgUfU7Ri9ZgqrG+eqLfFp4NcZ5u+e5VnS22K5YvmSUS+cFPVz8wkVJGgM= X-Bogosity: Ham, tests=bogofilter, spamicity=0.000007, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: <linux-mm.kvack.org> List-Subscribe: <mailto:majordomo@kvack.org> List-Unsubscribe: <mailto:majordomo@kvack.org> |
Series |
mm: Introduce a new sysctl knob vm.pcp_batch_scale_max
|
expand
|
diff --git a/mm/page_alloc.c b/mm/page_alloc.c index 47c0ce1d6fa1..d9371806f6b5 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -2614,7 +2614,8 @@ static void free_unref_page_commit(struct zone *zone, struct per_cpu_pages *pcp, pcp->flags &= ~PCPF_PREV_FREE_HIGH_ORDER; } if (pcp->free_count < (batch << CONFIG_PCP_BATCH_SCALE_MAX)) - pcp->free_count += (1 << order); + pcp->free_count = min(pcp->free_count + (1 << order), + batch << CONFIG_PCP_BATCH_SCALE_MAX); high = nr_pcp_high(pcp, zone, batch, free_high); if (pcp->count >= high) { free_pcppages_bulk(zone, nr_pcp_free(pcp, batch, high, free_high),