From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932105AbcGGKU1 (ORCPT ); Thu, 7 Jul 2016 06:20:27 -0400 Received: from mx2.suse.de ([195.135.220.15]:43215 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752072AbcGGKUZ (ORCPT ); Thu, 7 Jul 2016 06:20:25 -0400 Date: Thu, 7 Jul 2016 12:20:44 +0200 From: David Sterba To: Nikolay Borisov Cc: dsterba@suse.com, linux-btrfs@vger.kernel.org, linux-kernel@vger.kernel.org, clm@fb.com, jbacik@fb.com Subject: Re: [PATCH] btrfs: Fix slab accounting flags Message-ID: <20160707102044.GS13336@twin.jikos.cz> Reply-To: dsterba@suse.cz Mail-Followup-To: dsterba@suse.cz, Nikolay Borisov , dsterba@suse.com, linux-btrfs@vger.kernel.org, linux-kernel@vger.kernel.org, clm@fb.com, jbacik@fb.com References: <1466705828-26195-1-git-send-email-n.borisov.lkml@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1466705828-26195-1-git-send-email-n.borisov.lkml@gmail.com> User-Agent: Mutt/1.5.23.1 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jun 23, 2016 at 09:17:08PM +0300, Nikolay Borisov wrote: > BTRFS is using a variety of slab caches to satisfy internal needs. > Those slab caches are always allocated with the SLAB_RECLAIM_ACCOUNT, > meaning allocations from the caches are going to be accounted as > SReclaimable. At the same time btrfs is not registering any shrinkers > whatsoever, thus preventing memory from the slabs to be shrunk. This > means those caches are not in fact reclaimable. > > To fix this remove the SLAB_RECLAIM_ACCOUNT on all caches apart from the > inode cache, since this one is being freed by the generic VFS super_block > shrinker. Also set the transaction related caches as SLAB_TEMPORARY, > to better document the lifetime of the objects (it just translates > to SLAB_RECLAIM_ACCOUNT). > > Signed-off-by: Nikolay Borisov Reviewed-by: David Sterba