From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3D5FD4DA13 for ; Wed, 4 Sep 2024 06:49:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=45.249.212.188 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725432567; cv=none; b=F8vJV2BOcGHmET8TRI4WPkRXX4rk6bj+mxmN4hJ6IMs783GB5lT+52ssmJCfWzMWpGJYi7cmVkt7mHihoz8KLNO0F6bfjesROyyIKwVltQRp3Y2OHaBw/a+0UEb0z8fvKAf/LhIwfU6TRZTtKbCNipjutabK5hach7SpcLlujjk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725432567; c=relaxed/simple; bh=Q16vZrCD4ZoQPOeWawkRHhgAmtEnvP3sdLqXDbpGLFo=; h=Message-ID:Date:MIME-Version:CC:Subject:To:References:From: In-Reply-To:Content-Type; b=HQY5+FLyAabesTz/3cuFRzQ7xTty7WFFdYC3afn0vJDBUoIKC0h6jSDo/fxCqgq/tyKHQEdp1/oD+J170PIBrlrWC+fVdyPe8S5d+YRbS9dqS54a5XlL3M8O0gzoDVEPH0BYcwXN863Ii1kqjxjPZc417ZYF9gL0d/8cYMa3PLk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com; spf=pass smtp.mailfrom=huawei.com; arc=none smtp.client-ip=45.249.212.188 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=huawei.com Received: from mail.maildlp.com (unknown [172.19.162.254]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4WzCjF44HyzpV38; Wed, 4 Sep 2024 14:47:29 +0800 (CST) Received: from kwepemg100017.china.huawei.com (unknown [7.202.181.58]) by mail.maildlp.com (Postfix) with ESMTPS id EBFBF180105; Wed, 4 Sep 2024 14:49:21 +0800 (CST) Received: from [10.174.178.120] (10.174.178.120) by kwepemg100017.china.huawei.com (7.202.181.58) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.11; Wed, 4 Sep 2024 14:49:21 +0800 Message-ID: Date: Wed, 4 Sep 2024 14:49:20 +0800 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird CC: , , , , , , , , Subject: Re: [PATCH] mm, proc: collect percpu free pages into the free pages Content-Language: en-US To: References: <20240830014453.3070909-1-mawupeng1@huawei.com> <87a5guh2fb.fsf@yhuang6-desk2.ccr.corp.intel.com> <2ee7cb17-9003-482c-9741-f1f51f61ab4b@huawei.com> <871q22hmga.fsf@yhuang6-desk2.ccr.corp.intel.com> <193da117-30b8-425a-b095-6fd8aca1c987@huawei.com> From: mawupeng In-Reply-To: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit X-ClientProxiedBy: dggems703-chm.china.huawei.com (10.3.19.180) To kwepemg100017.china.huawei.com (7.202.181.58) On 2024/9/3 16:09, Michal Hocko wrote: > On Tue 03-09-24 09:50:48, mawupeng wrote: >>> Drain remote PCP may be not that expensive now after commit 4b23a68f9536 >>> ("mm/page_alloc: protect PCP lists with a spinlock"). No IPI is needed >>> to drain the remote PCP. >> >> This looks really great, we can think a way to drop pcp before goto slowpath >> before swap. > > We currently drain after first unsuccessful direct reclaim run. Is that > insufficient? The reason i said the drain of pcp is insufficient or expensive is based on you comment[1] :-). Since IPIs is not requiered since commit 4b23a68f9536 ("mm/page_alloc: protect PCP lists with a spinlock"). This could be much better. [1]: https://lore.kernel.org/linux-mm/ZWRYZmulV0B-Jv3k@tiehlicka/ > Should we do a less aggressive draining sooner? Ideally > restricted to cpus on the same NUMA node maybe? Do you have any specific > workloads that would benefit from this? Current the problem is amount the pcp, which can increase to 4.6%(24644M) of the total 512G memory.