Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751954AbaJOKAu (ORCPT ); Wed, 15 Oct 2014 06:00:50 -0400 Received: from mailout2.samsung.com ([203.254.224.25]:56641 "EHLO mailout2.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751257AbaJOKAs (ORCPT ); Wed, 15 Oct 2014 06:00:48 -0400 X-AuditID: cbfee68d-f79296d000004278-0d-543e45ce257d From: Heesub Shin To: Dan Streetman , Seth Jennings , Andrew Morton Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, Sunae Seo , Heesub Shin Subject: [PATCH] mm/zbud: init user ops only when it is needed Date: Wed, 15 Oct 2014 19:00:43 +0900 Message-id: <1413367243-23524-1-git-send-email-heesub.shin@samsung.com> X-Mailer: git-send-email 1.9.1 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrFLMWRmVeSWpSXmKPExsVy+t8zTd1zrnYhBh9/SVjMWb+GzeLlIU2L C227WSwOzl7CZHF51xw2i3tr/rNafDr6iM2icfc7NgcOj6cTDjJ5bPo0id3jxIzfLB59W1Yx elz/VuTxeZNcAFsUl01Kak5mWWqRvl0CV0bzz1dMBf/ZK+78/MjawHiGrYuRk0NCwETiVNMa RghbTOLCvfVAcS4OIYFljBLzNv9nhina+eUbI0RiOqPE1JufoJx2JomrK38zdTFycLAJaEsc 2hYMYooI1ElM/hwHUsIs0ABUv/MG2CBhATuJfY+usYPUsAioSszaaAUS5hVwl1i16RgTxC45 iZPHJrOC9EoI9LNLXN3cyQ6SYBEQkPg2+RALSK+EgKzEpgNQt0lKHFxxg2UCo+ACRoZVjKKp BckFxUnpRYZ6xYm5xaV56XrJ+bmbGCFB3LuD8fYB60OMAhyMSjy8Fq9sQ4RYE8uKK3MPMZoC bZjILCWanA+MlbySeENjMyMLUxNTYyNzSzMlcV5FqZ/BQgLpiSWp2ampBalF8UWlOanFhxiZ ODilGhjZL0eV7tPw/KTecOONQ/G2PT+2TdvexT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CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org When zbud is initialized through the zpool wrapper, pool->ops which points to user-defined operations is always set regardless of whether it is specified from the upper layer. This causes zbud_reclaim_page() to iterate its loop for evicting pool pages out without any gain. This patch sets the user-defined ops only when it is needed, so that zbud_reclaim_page() can bail out the reclamation loop earlier if there is no user-defined operations specified. Signed-off-by: Heesub Shin --- mm/zbud.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/zbud.c b/mm/zbud.c index ecf1dbe..db8de74 100644 --- a/mm/zbud.c +++ b/mm/zbud.c @@ -132,7 +132,7 @@ static struct zbud_ops zbud_zpool_ops = { static void *zbud_zpool_create(gfp_t gfp, struct zpool_ops *zpool_ops) { - return zbud_create_pool(gfp, &zbud_zpool_ops); + return zbud_create_pool(gfp, zpool_ops ? &zbud_zpool_ops : NULL); } static void zbud_zpool_destroy(void *pool) -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/