Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751543AbdHPHuO (ORCPT ); Wed, 16 Aug 2017 03:50:14 -0400 Received: from outboundhk.mxmail.xiaomi.com ([207.226.244.124]:31646 "EHLO xiaomi.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751068AbdHPHuN (ORCPT ); Wed, 16 Aug 2017 03:50:13 -0400 From: Hui Zhu To: , , , , CC: , Hui Zhu Subject: [PATCH] zsmalloc: zs_page_isolate: skip unnecessary loops but not return false if zspage is not inuse Date: Wed, 16 Aug 2017 15:49:54 +0800 Message-ID: <1502869794-29263-1-git-send-email-zhuhui@xiaomi.com> X-Mailer: git-send-email 1.9.1 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.235.171.194] X-ClientProxiedBy: CNCAS3.mioffice.cn (10.237.8.133) To cnbox6.mioffice.cn (10.237.8.146) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1038 Lines: 33 Like [1], zs_page_isolate meet the same problem if zspage is not inuse. After [2], zs_page_migrate can support empty zspage now. Make this patch to let zs_page_isolate skip unnecessary loops but not return false if zspage is not inuse. [1] zsmalloc-zs_page_migrate-skip-unnecessary-loops-but-not-return-ebusy-if-zspage-is-not-inuse-fix.patch [2] zsmalloc-zs_page_migrate-schedule-free_work-if-zspage-is-ZS_EMPTY.patch Signed-off-by: Hui Zhu --- mm/zsmalloc.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/mm/zsmalloc.c b/mm/zsmalloc.c index fb99953..8560c93 100644 --- a/mm/zsmalloc.c +++ b/mm/zsmalloc.c @@ -1927,11 +1927,6 @@ bool zs_page_isolate(struct page *page, isolate_mode_t mode) class = pool->size_class[class_idx]; spin_lock(&class->lock); - if (get_zspage_inuse(zspage) == 0) { - spin_unlock(&class->lock); - return false; - } - /* zspage is isolated for object migration */ if (list_empty(&zspage->list) && !is_zspage_isolated(zspage)) { spin_unlock(&class->lock); -- 1.9.1