From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751450AbdGQNjy (ORCPT ); Mon, 17 Jul 2017 09:39:54 -0400 Received: from mx1.redhat.com ([209.132.183.28]:60036 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751278AbdGQNjw (ORCPT ); Mon, 17 Jul 2017 09:39:52 -0400 DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com E8ECF7DCE9 Authentication-Results: ext-mx03.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx03.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=longman@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com E8ECF7DCE9 From: Waiman Long To: Alexander Viro , Jonathan Corbet Cc: linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org, linux-fsdevel@vger.kernel.org, "Paul E. McKenney" , Andrew Morton , Ingo Molnar , Miklos Szeredi , Waiman Long Subject: [PATCH 0/4] fs/dcache: Limit # of negative dentries Date: Mon, 17 Jul 2017 09:39:29 -0400 Message-Id: <1500298773-7510-1-git-send-email-longman@redhat.com> X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Mon, 17 Jul 2017 13:39:52 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org A rogue application can potentially create a large number of negative dentries in the system consuming most of the memory available. This can impact performance of other applications running on the system. This patchset introduces changes to the dcache subsystem to limit the number of negative dentries allowed to be created thus limiting the amount of memory that can be consumed by negative dentries. Patch 1 tracks the number of negative dentries used and disallow the creation of more when the limit is reached. Patch 2 enables /proc/sys/fs/dentry-state to report the number of negative dentries in the system. Patch 3 enables automatic pruning of negative dentries when it is close to the limit. Patch 4 prevents racing between negative dentry pruning and umount operation. Waiman Long (4): fs/dcache: Limit numbers of negative dentries fs/dcache: Report negative dentry number in dentry-state fs/dcache: Enable automatic pruning of negative dentries fs/dcache: Protect negative dentry pruning from racing with umount Documentation/admin-guide/kernel-parameters.txt | 7 + fs/dcache.c | 312 +++++++++++++++++++++++- include/linux/dcache.h | 8 +- include/linux/list_lru.h | 1 + mm/list_lru.c | 4 +- 5 files changed, 327 insertions(+), 5 deletions(-) -- 1.8.3.1