From patchwork Mon Jan 23 23:32:28 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gavin Shan X-Patchwork-Id: 718830 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [103.22.144.68]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3v6nhn59hwz9t17 for ; Tue, 24 Jan 2017 10:34:33 +1100 (AEDT) Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 3v6nhn2xYbzDqfg for ; Tue, 24 Jan 2017 10:34:33 +1100 (AEDT) X-Original-To: linuxppc-dev@lists.ozlabs.org Delivered-To: linuxppc-dev@lists.ozlabs.org Received: from mx0a-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 3v6ngg2fgQzDqHT for ; Tue, 24 Jan 2017 10:33:35 +1100 (AEDT) Received: from pps.filterd (m0098413.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.20/8.16.0.20) with SMTP id v0NNT3Ui082755 for ; Mon, 23 Jan 2017 18:33:32 -0500 Received: from e23smtp05.au.ibm.com (e23smtp05.au.ibm.com [202.81.31.147]) by mx0b-001b2d01.pphosted.com with ESMTP id 285r3pq533-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Mon, 23 Jan 2017 18:33:32 -0500 Received: from localhost by e23smtp05.au.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 24 Jan 2017 09:33:29 +1000 Received: from d23dlp01.au.ibm.com (202.81.31.203) by e23smtp05.au.ibm.com (202.81.31.211) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Tue, 24 Jan 2017 09:33:27 +1000 Received: from d23relay08.au.ibm.com (d23relay08.au.ibm.com [9.185.71.33]) by d23dlp01.au.ibm.com (Postfix) with ESMTP id E6D4E2CE8046 for ; Tue, 24 Jan 2017 10:33:26 +1100 (EST) Received: from d23av05.au.ibm.com (d23av05.au.ibm.com [9.190.234.119]) by d23relay08.au.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id v0NNXI3G16318480 for ; Tue, 24 Jan 2017 10:33:26 +1100 Received: from d23av05.au.ibm.com (localhost [127.0.0.1]) by d23av05.au.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id v0NNWs8r003517 for ; Tue, 24 Jan 2017 10:32:54 +1100 Received: from ozlabs.au.ibm.com (ozlabs.au.ibm.com [9.192.253.14]) by d23av05.au.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with ESMTP id v0NNWsNh003110; Tue, 24 Jan 2017 10:32:54 +1100 Received: from bran.ozlabs.ibm.com (haven.au.ibm.com [9.192.254.114]) by ozlabs.au.ibm.com (Postfix) with ESMTP id EE97FA0150; Tue, 24 Jan 2017 10:32:29 +1100 (AEDT) Received: from gwshan.ozlabs.ibm.com (shangw.ozlabs.ibm.com [10.61.2.199]) by bran.ozlabs.ibm.com (Postfix) with ESMTP id DFCF2E3D0C; Tue, 24 Jan 2017 10:32:29 +1100 (AEDT) Received: by gwshan.ozlabs.ibm.com (Postfix, from userid 1000) id D2158AC27F3; Tue, 24 Jan 2017 10:32:29 +1100 (AEDT) From: Gavin Shan To: linuxppc-dev@lists.ozlabs.org Subject: [PATCH] powerpc/mm: Fix RECLAIM_DISTANCE Date: Tue, 24 Jan 2017 10:32:28 +1100 X-Mailer: git-send-email 2.7.4 X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 17012323-0016-0000-0000-00000211C3BD X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17012323-0017-0000-0000-0000064BA3D3 Message-Id: <1485214348-19487-1-git-send-email-gwshan@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2017-01-23_20:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=1 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1612050000 definitions=main-1701230292 X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Gavin Shan Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org Sender: "Linuxppc-dev" When @node_reclaim_mode ("/proc/sys/vm/zone_reclaim_mode") is enabled, the nodes in the specified distance (< RECLAIM_DISTANCE) to the preferred one will be checked for page direct reclaim in the fast path, as below function call chain indicates. Currently, RECLAIM_DISTANCE is set to 10, equal to LOCAL_DISTANCE. It means no nodes, including the preferred one, don't match the conditions. So no nodes are checked for direct reclaim in the fast path. __alloc_pages_nodemask get_page_from_freelist zone_allows_reclaim This fixes it by setting RECLAIM_DISTANCE to 30. With it, the preferred node and its directly adjacent nodes will be checked for page direct reclaim. The comments explaining RECLAIM_DISTANCE is out of date. This updates and makes it correct. Signed-off-by: Gavin Shan --- arch/powerpc/include/asm/topology.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/arch/powerpc/include/asm/topology.h b/arch/powerpc/include/asm/topology.h index 8b3b46b..ce1a156 100644 --- a/arch/powerpc/include/asm/topology.h +++ b/arch/powerpc/include/asm/topology.h @@ -9,10 +9,11 @@ struct device_node; #ifdef CONFIG_NUMA /* - * If zone_reclaim_mode is enabled, a RECLAIM_DISTANCE of 10 will mean that - * all zones on all nodes will be eligible for zone_reclaim(). + * If node_reclaim_mode is enabled, a RECLAIM_DISTANCE of 30 means that + * the preferred node and its directly adjacent nodes are eligible for + * node_reclaim(). */ -#define RECLAIM_DISTANCE 10 +#define RECLAIM_DISTANCE 30 #include