From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751647AbdAYJeF (ORCPT ); Wed, 25 Jan 2017 04:34:05 -0500 Received: from out0-157.mail.aliyun.com ([140.205.0.157]:34704 "EHLO out0-157.mail.aliyun.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751601AbdAYJdl (ORCPT ); Wed, 25 Jan 2017 04:33:41 -0500 X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R141e4;FP=0|-1|-1|-1|0|-1|-1|-1;HT=e02c03292;MF=hillf.zj@alibaba-inc.com;NM=1;PH=DS;RN=7;SR=0;TI=SMTPD_---.7W7FsXR_1485336796; Reply-To: "Hillf Danton" From: "Hillf Danton" To: "'Mel Gorman'" , "'Andrew Morton'" Cc: "'Tejun Heo'" , "'Vlastimil Babka'" , "'Linux Kernel'" , "'Linux-MM'" , "'Jesper Dangaard Brouer'" References: <20170125083038.rzb5f43nptmk7aed@techsingularity.net> In-Reply-To: <20170125083038.rzb5f43nptmk7aed@techsingularity.net> Subject: Re: [PATCH] mm, page_alloc: Use static global work_struct for draining per-cpu pages Date: Wed, 25 Jan 2017 17:33:16 +0800 Message-ID: <004201d276ee$0f20fd80$2d62f880$@alibaba-inc.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Outlook 14.0 Thread-Index: AQK/1CnN30ODrzKJqHC8877V2X9hYp9uMzAg Content-Language: zh-cn Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wednesday, January 25, 2017 4:31 PM Mel Gorman wrote: > > As suggested by Vlastimil Babka and Tejun Heo, this patch uses a static > work_struct to co-ordinate the draining of per-cpu pages on the workqueue. > Only one task can drain at a time but this is better than the previous > scheme that allowed multiple tasks to send IPIs at a time. > > One consideration is whether parallel requests should synchronise against > each other. This patch does not synchronise for a global drain as the common > case for such callers is expected to be multiple parallel direct reclaimers > competing for pages when the watermark is close to min. Draining the per-cpu > list is unlikely to make much progress and serialising the drain is of > dubious merit. Drains are synchonrised for callers such as memory hotplug > and CMA that care about the drain being complete when the function returns. > > Signed-off-by: Mel Gorman > --- Acked-by: Hillf Danton