Received: by 10.192.165.156 with SMTP id m28csp786407imm; Fri, 13 Apr 2018 07:50:24 -0700 (PDT) X-Google-Smtp-Source: AIpwx4+yEZxm0h5+7fVAj4ydmcoy9r4xu70BrlKoIRIItnrMHIJF8p7nuFxsXHn9sUsAe0dZgEK3 X-Received: by 2002:a17:902:28e3:: with SMTP id f90-v6mr5607616plb.250.1523631024386; Fri, 13 Apr 2018 07:50:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523631024; cv=none; d=google.com; s=arc-20160816; b=0ICxP3kwc41XbKk7+FhwIAFrEBOxgZq0zaoNDc51NWa0SmfCDh3nLB3Q3EAxmLqDGf h1jp7itI/VdmUdHrsyzS1H/lmHJoNuIwQ0uWAe/jmbmjLnRESoHwxJgPbhw8RMhX/fel AJUTwQIEq0utTxQhedwiidHMgIlLTI1+2xvAJiALHOb3ML+UAG39dNxqcge+szmqJBgS a4JUMaP2gs2vXmuHgZRKwQoExo6eNhPyFR7+FmpiewceepnkH6L9vK1ocTqA/5Xb9Th+ +7X0rmV9dRlLHfwJQZNbScJt2z0EclRkomIc6yiCrfkAd0rKTuR6G3Od3ZonY22L6dGp 8AjA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=b/nZvDbHOQ7q87h/v3oG7LLSCNAhviYI4UoEkal2Cr8=; b=I1/U0BrBzrqdZj6cJ6vhccHly4yAK45Brd2/Jox1fXiE7TsIy0iU8mI31SrbI6QmNn wM0UnH1Zgn3IxCpzvnNZncgFToDKIyXZ5rrT0x3l20l0Tsj8mdrySbcyyHYw5msJQIiX vXoabTKgLQyksyYkDA7rUpM9iXC81HHlafRHEebc/w6UmyiXytCDO2bbFCJieN5g1hLe upSl+gb//9Xt3UfSNJC/vw1s4nCc8n0hwb/pQWysD/792EmQdawzruu0hgw83MKW2Gr7 djvscvmlw4EG+Z2S5sRQdozgubcBlJyTtZ0ePoV/LYx3Uz+QiZUaWSZZBt6Bc5cXxAHD U5IQ== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y12si4591051pfm.33.2018.04.13.07.50.10; Fri, 13 Apr 2018 07:50:24 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754170AbeDMN72 (ORCPT + 99 others); Fri, 13 Apr 2018 09:59:28 -0400 Received: from mx2.suse.de ([195.135.220.15]:53099 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753588AbeDMN71 (ORCPT ); Fri, 13 Apr 2018 09:59:27 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 80535AC50; Fri, 13 Apr 2018 13:59:25 +0000 (UTC) Date: Fri, 13 Apr 2018 15:59:23 +0200 From: Michal Hocko To: Minchan Kim Cc: Roman Gushchin , linux-mm@kvack.org, Andrew Morton , Alexander Viro , Johannes Weiner , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, kernel-team@fb.com Subject: Re: [PATCH 3/3] dcache: account external names as indirectly reclaimable memory Message-ID: <20180413135923.GT17484@dhcp22.suse.cz> References: <20180305133743.12746-1-guro@fb.com> <20180305133743.12746-5-guro@fb.com> <20180413133519.GA213834@rodete-laptop-imager.corp.google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180413133519.GA213834@rodete-laptop-imager.corp.google.com> User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri 13-04-18 22:35:19, Minchan Kim wrote: > On Mon, Mar 05, 2018 at 01:37:43PM +0000, Roman Gushchin wrote: [...] > > @@ -1614,9 +1623,11 @@ struct dentry *__d_alloc(struct super_block *sb, const struct qstr *name) > > name = &slash_name; > > dname = dentry->d_iname; > > } else if (name->len > DNAME_INLINE_LEN-1) { > > - size_t size = offsetof(struct external_name, name[1]); > > - struct external_name *p = kmalloc(size + name->len, > > - GFP_KERNEL_ACCOUNT); > > + struct external_name *p; > > + > > + reclaimable = offsetof(struct external_name, name[1]) + > > + name->len; > > + p = kmalloc(reclaimable, GFP_KERNEL_ACCOUNT); > > Can't we use kmem_cache_alloc with own cache created with SLAB_RECLAIM_ACCOUNT > if they are reclaimable? No, because names have different sizes and so we would basically have to duplicate many caches. -- Michal Hocko SUSE Labs