Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp709272imm; Wed, 18 Jul 2018 09:18:44 -0700 (PDT) X-Google-Smtp-Source: AAOMgpc/0pK/cEdXvGkiLBl2qR0q9fzRaJA9i8WpcC05Wuxwm5TiLG6e9Mg7MMqLtncP1US4hYP+ X-Received: by 2002:a65:62ce:: with SMTP id m14-v6mr6376927pgv.407.1531930724534; Wed, 18 Jul 2018 09:18:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531930724; cv=none; d=google.com; s=arc-20160816; b=K/8fSEN5sI5Gcfa188a8w/c+NAvM1Cyiu5bOgluWhgJfUUyJhlLFLDNZh/DYO3bDAS TcMxTpegpQp+RklHdWoDTVCVA80is6C8zptr1dTOMN+r91DK3/5yiWZYcOhZSbUBXm1H bn6HYtNWi3qgYHQZcuLXPGIkAu9V7R8LpMTVdyUYQAG1mryFMyBk1idSw+FwMzEKqbaS +T5vVPCtx9iJ9IHa4NClhi52G1sF9N+q88ZKxJX786bb5FqGIT10TIf1JhNmPc6t/fNi gpQI7UYHlTk3giYZ05qAtEgnJB52BrYI9KG+Rr27xUp335XR6z9reWr/Yd0Vs038qDbh PzRQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-language :content-transfer-encoding:in-reply-to:mime-version:user-agent:date :message-id:organization:from:references:cc:to:subject :arc-authentication-results; bh=eGqoqXR0+97WJL28HbrJAedlh5/sG+rVX2b+e4/6Nmk=; b=cKSQ3c1uGRuf4N8ZoFsHgj6UVsQU7NdHm3fi0X8MSlZ6iXgSuiE+e+aZ7/W1mhiWTO R8f/l2RgtLFMgb/mCnaDYTzbrGUiaRMVVbvepc2t2MUDR3AfH7fI+sYoOctNYASAE9uk Jnz9oPRAdAE0RTIG0E87bc+l+4F6vT5hGqygEvsmIMem62ZoXtA6IiZBXc2ATLGmkGpg vhedNGxww8LJu+7oySOUOtETB8A3NAxoGkbR4a+cFGSo30bgaZuWVr9ohMPsBXbeKG3A nLWR9fxNorOEx2QwwdHvwxTSP4uZRdgs6BeKI9T5+4wErsdszcfQc2xVJZywSNxpZX7G 3UYA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n1-v6si3365655plp.166.2018.07.18.09.18.29; Wed, 18 Jul 2018 09:18:44 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731888AbeGRQ4F convert rfc822-to-8bit (ORCPT + 99 others); Wed, 18 Jul 2018 12:56:05 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:54378 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1731325AbeGRQ4E (ORCPT ); Wed, 18 Jul 2018 12:56:04 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 50B6A401EF07; Wed, 18 Jul 2018 16:17:25 +0000 (UTC) Received: from llong.remote.csb (dhcp-17-175.bos.redhat.com [10.18.17.175]) by smtp.corp.redhat.com (Postfix) with ESMTP id 55C382026D69; Wed, 18 Jul 2018 16:17:24 +0000 (UTC) Subject: Re: [PATCH v6 0/7] fs/dcache: Track & limit # of negative dentries To: Michal Hocko , Dave Chinner Cc: James Bottomley , Linus Torvalds , Matthew Wilcox , Al Viro , Jonathan Corbet , "Luis R. Rodriguez" , Kees Cook , Linux Kernel Mailing List , linux-fsdevel , linux-mm , "open list:DOCUMENTATION" , Jan Kara , Paul McKenney , Andrew Morton , Ingo Molnar , Miklos Szeredi , Larry Woodman , "Wangkai (Kevin,C)" References: <1531330947.3260.13.camel@HansenPartnership.com> <18c5cbfe-403b-bb2b-1d11-19d324ec6234@redhat.com> <1531336913.3260.18.camel@HansenPartnership.com> <4d49a270-23c9-529f-f544-65508b6b53cc@redhat.com> <1531411494.18255.6.camel@HansenPartnership.com> <20180712164932.GA3475@bombadil.infradead.org> <1531416080.18255.8.camel@HansenPartnership.com> <1531425435.18255.17.camel@HansenPartnership.com> <20180713003614.GW2234@dastard> <20180716090901.GG17280@dhcp22.suse.cz> From: Waiman Long Organization: Red Hat Message-ID: Date: Wed, 18 Jul 2018 12:17:24 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.0 MIME-Version: 1.0 In-Reply-To: <20180716090901.GG17280@dhcp22.suse.cz> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8BIT Content-Language: en-US X-Scanned-By: MIMEDefang 2.78 on 10.11.54.4 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.5]); Wed, 18 Jul 2018 16:17:25 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.5]); Wed, 18 Jul 2018 16:17:25 +0000 (UTC) for IP:'10.11.54.4' DOMAIN:'int-mx04.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'longman@redhat.com' RCPT:'' Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 07/16/2018 05:09 AM, Michal Hocko wrote: > On Fri 13-07-18 10:36:14, Dave Chinner wrote: > [...] >> By limiting the number of negative dentries in this case, internal >> slab fragmentation is reduced such that reclaim cost never gets out >> of control. While it appears to "fix" the symptoms, it doesn't >> address the underlying problem. It is a partial solution at best but >> at worst it's another opaque knob that nobody knows how or when to >> tune. > Would it help to put all the negative dentries into its own slab cache? > >> Very few microbenchmarks expose this internal slab fragmentation >> problem because they either don't run long enough, don't create >> memory pressure, or don't have access patterns that mix long and >> short term slab objects together in a way that causes slab >> fragmentation. Run some cold cache directory traversals (git >> status?) at the same time you are creating negative dentries so you >> create pinned partial pages in the slab cache and see how the >> behaviour changes.... > Agreed! Slab fragmentation is a real problem we are seeing for quite > some time. We should try to address it rather than paper over it with > weird knobs. I am aware that you don't like the limit knob that control how many negative dentries are allowed as a percentage of total system memory. I got comments in the past about doing some kind of auto-tuning. How about consolidating the 2 knobs that I currently have in the patchset into a single one with 3 possible values, like: 0 - no limiting 1 - set soft limit to "a constant + 4 x max # of positive dentries" and warn if exceeded 2 - same limit but kill excess negative dentries after use. Does that kind of knob make more sense to you? Cheers, Longman