From patchwork Mon Jul 25 17:12:13 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nikolay Borisov X-Patchwork-Id: 9246065 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 9D88D6077C for ; Mon, 25 Jul 2016 17:12:24 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8BC9F252D2 for ; Mon, 25 Jul 2016 17:12:24 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 80A1D26490; Mon, 25 Jul 2016 17:12:24 +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_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, 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 16494252D2 for ; Mon, 25 Jul 2016 17:12:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752842AbcGYRMW (ORCPT ); Mon, 25 Jul 2016 13:12:22 -0400 Received: from mail-wm0-f65.google.com ([74.125.82.65]:35529 "EHLO mail-wm0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752143AbcGYRMU (ORCPT ); Mon, 25 Jul 2016 13:12:20 -0400 Received: by mail-wm0-f65.google.com with SMTP id i5so17634874wmg.2; Mon, 25 Jul 2016 10:12:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=R0toJr1IICZ7O/cTRlWYYAY1qh25oNw0Jx/YZQPtoa4=; b=VqR7V3jQo5y/DkT+jgULMCAtFIf4FhIukv4dRHJSIIQhIm52MMYU+ZtcWL1kpMvRC/ qhtH3fB+eLDGzKVISbK+unx/pjYZ6pZtbgj1p666zS8hoAoF9AJNfk09LapbFKAITZsj /4cOJuQh3xeIseaOr1/07EMWwoUhPPWITu6WnYwof0KgxmlwVkwU7l4MplzF8TXK+bwN BbEY06bIbCP1LMhDMbsviyAvz4R2swN/Sxk54GLe2DbjGVvTgDYmdwGzm3VQ4p1v0p6c vH5jc4GcSJcZq6uTMbwuHkQ5iwCxrTgZhNT/EpuuUW6aDaHgVFxchh8gwneGePES/agH Y9iQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=R0toJr1IICZ7O/cTRlWYYAY1qh25oNw0Jx/YZQPtoa4=; b=BAm2t1hX6KqO9GemcyomxlKm96PJkOVcDRUWnnd3UsXLP74RI+IEViDdwaoogJxjuQ Lz5pdPA6hzzK+f+xdLd9ZO8FgCNG1CB5t8p5TNtMYEFeVg5B2Km8TpiTcxgo2G9B/o8+ 0juRYMSpNfHk9GejaoTyEVpBUsaLFZdARgsC9Dcp2VoGfh8SuRPzm4ksuueC0d4OL+sJ eU2ed8QQJTOes3Yor3iPEBleq8MkCgXVo5BWipMm0/Lg+E0u9NZ5/aRCx4eyW2lUH0I5 4gsJHN+uevb8UwPt35FNU1Cpfe4CD9ABLTdge1XA4PO7BkaEdpDV9nAWW/Y3MpiCf22O e3EA== X-Gm-Message-State: AEkoousDmwHa4AiAScrrQVBQ75wBs4I7D/vCXgDB6cHeHWqCQXH8X3GMPLOGkcML8mUi9w== X-Received: by 10.28.52.142 with SMTP id b136mr20496848wma.35.1469466739276; Mon, 25 Jul 2016 10:12:19 -0700 (PDT) Received: from fisk.lan ([84.40.82.183]) by smtp.gmail.com with ESMTPSA id r127sm28359744wmf.23.2016.07.25.10.12.18 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 25 Jul 2016 10:12:18 -0700 (PDT) From: Nikolay Borisov To: zyan@redhat.com, sage@redhat.com, idryomov@gmail.com Cc: ceph-devel@vger.kernel.org, linux-kernel@vger.kernel.org, Nikolay Borisov Subject: [PATCH v2] ceph: Mark the file cache as unreclaimable Date: Mon, 25 Jul 2016 20:12:13 +0300 Message-Id: <1469466733-9092-1-git-send-email-n.borisov.lkml@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1469466572-8939-1-git-send-email-n.borisov.lkml@gmail.com> References: <1469466572-8939-1-git-send-email-n.borisov.lkml@gmail.com> 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 Ceph creates multiple caches with the SLAB_RECLAIMABLE flag set, so that it can satisfy its internal needs. Inspecting the code shows that most of the caches are indeed reclaimable since they are directly related to the generic inode/dentry shrinkers. However, one of the cache used to satisfy struct file is not reclaimable since its entries are freed only when the last reference to the file is dropped. If a heavily loaded node opens a lot of files it can introduce non-trivial discrepancies between memory shown as reclaimable and what is actually reclaimed when drop_caches is used. Fix this by removing the reclaimable flag for the file's cache. Signed-off-by: Nikolay Borisov --- Fixed checkpatch warning + missing SOB line fs/ceph/super.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/ceph/super.c b/fs/ceph/super.c index 91e02481ce06..8697cac6add0 100644 --- a/fs/ceph/super.c +++ b/fs/ceph/super.c @@ -672,8 +672,8 @@ static int __init init_caches(void) if (ceph_dentry_cachep == NULL) goto bad_dentry; - ceph_file_cachep = KMEM_CACHE(ceph_file_info, - SLAB_RECLAIM_ACCOUNT|SLAB_MEM_SPREAD); + ceph_file_cachep = KMEM_CACHE(ceph_file_info, SLAB_MEM_SPREAD); + if (ceph_file_cachep == NULL) goto bad_file;