From patchwork Tue Feb 27 05:49:44 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chengguang Xu X-Patchwork-Id: 10244325 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id B88DE60384 for ; Tue, 27 Feb 2018 05:50:12 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A90172A532 for ; Tue, 27 Feb 2018 05:50:12 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9CDA72A4CA; Tue, 27 Feb 2018 05:50:12 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2BEA32A4B8 for ; Tue, 27 Feb 2018 05:50:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751117AbeB0FuI (ORCPT ); Tue, 27 Feb 2018 00:50:08 -0500 Received: from mr11p00im-asmtp004.me.com ([17.110.69.135]:39776 "EHLO mr11p00im-asmtp004.me.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750828AbeB0FuH (ORCPT ); Tue, 27 Feb 2018 00:50:07 -0500 Received: from process-dkim-sign-daemon.mr11p00im-asmtp004.me.com by mr11p00im-asmtp004.me.com (Oracle Communications Messaging Server 8.0.1.2.20170607 64bit (built Jun 7 2017)) id <0P4S00H00NG5S700@mr11p00im-asmtp004.me.com> for ceph-devel@vger.kernel.org; Tue, 27 Feb 2018 05:49:52 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=icloud.com; s=04042017; t=1519710592; bh=dO01TCCu10b0dFFi6wBcUfOr0zvF6eSPuMbrpROOx8k=; h=From:To:Subject:Date:Message-id; b=MhgrK4HoV3KCxiFFrBLlxh6gbrBJ2qyBiBd9w/irpkYW3OkTtyqx0pqmRGxfkoFBK NHuLI1KkfulXPqaagnC7t7TAxL/vOUtPViJ4xaVkD201iwxTGYCf/bryMDJ6stSyoR dsqQPVCiDFjgDyXYpS65YTfa4a4XMipBy755wMgGT7DVwIoSipFGKwWV0cKGAN7+Ko R6gIk0bZxnK5InfoceGS6sdElnBFiknkWv0SmbRYd2KNzAaXhWER5SpT8ZbEeNnStQ QtP8jKULZ5WEUHje15yJUA9Zb3ocykBgh+gW4rKpXZZ2IirLfA74HUS/CmJ6TY/V3N /zt+JSOove0hw== Received: from icloud.com ([127.0.0.1]) by mr11p00im-asmtp004.me.com (Oracle Communications Messaging Server 8.0.1.2.20170607 64bit (built Jun 7 2017)) with ESMTPSA id <0P4S00FA9O6YIP30@mr11p00im-asmtp004.me.com>; Tue, 27 Feb 2018 05:49:51 +0000 (GMT) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2018-02-27_03:,, signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 clxscore=1015 suspectscore=0 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1707230000 definitions=main-1802270066 From: Chengguang Xu To: zyan@redhat.com, idryomov@gmail.com Cc: ceph-devel@vger.kernel.org, Chengguang Xu Subject: [PATCH] ceph: mark the cap cache as unreclaimable Date: Tue, 27 Feb 2018 13:49:44 +0800 Message-id: <1519710584-60240-1-git-send-email-cgxu519@icloud.com> X-Mailer: git-send-email 1.8.3.1 Sender: ceph-devel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: ceph-devel@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Releasing cap is affected by many factors (e.g., avail_count/reserve_count/min_count) and min_count could be specified high volume in client mount option. Hence it's better to mark cap cache as unreclaimable in case of non-trivial discrepancies between memory shown as reclaimable and what is actually reclaimed. Signed-off-by: Chengguang Xu --- fs/ceph/super.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/fs/ceph/super.c b/fs/ceph/super.c index a62d2a9..3482834 100644 --- a/fs/ceph/super.c +++ b/fs/ceph/super.c @@ -696,8 +696,7 @@ static int __init init_caches(void) if (!ceph_inode_cachep) return -ENOMEM; - ceph_cap_cachep = KMEM_CACHE(ceph_cap, - SLAB_RECLAIM_ACCOUNT|SLAB_MEM_SPREAD); + ceph_cap_cachep = KMEM_CACHE(ceph_cap, SLAB_MEM_SPREAD); if (!ceph_cap_cachep) goto bad_cap; ceph_cap_flush_cachep = KMEM_CACHE(ceph_cap_flush,