Received: by 10.192.165.156 with SMTP id m28csp789630imm; Fri, 13 Apr 2018 07:53:46 -0700 (PDT) X-Google-Smtp-Source: AIpwx48dxIZd/7rxhpA9Hwoinpd6V33+JUjj12fyilCzZYbFMN8YQHBKvwvVkNoEhHZLsAZJUOP9 X-Received: by 10.99.98.2 with SMTP id w2mr4368925pgb.409.1523631226612; Fri, 13 Apr 2018 07:53:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523631226; cv=none; d=google.com; s=arc-20160816; b=VjAm664T0fH9vAjAvoBR1ICppcfgRlcO6bMkD3w/BjdRNPA6BSWxdQQZ9fmCOvBAci iFoEn85eXEJ6JJFmk3ZlLvLyjgP2v3B31G9VyhuvUtGlQWn9FOYlxjS9nTiUGllNyjv/ FYisjXH8AhsOEi5RHHBXQFEqV+LrHQhTaQ2eqftUeY0Fv4Q/7U/uQ4ht6azjejaKBP/T EAmRYDaE4YfNsTM5XLLmEf1xfFTzPEFZai/auwVt7Y1BtTHckeQQMDjXvJ9FjW9I+uC8 hl7ugSlqfSDHGOqjf4dRBd54ctWJXWPEYgOO6Hk1oL7CTMnZxtamNCY6YtZkuP9n+QNw 4KBg== 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=FP/EZ885Lt1KZS6QQl2x8VapLiR8cRS2HGG1nCgLvJc=; b=mu3EUwxcEj/l9FBjq5KU7jzNApPNphiuRlwWqKP8DFMMQHRm1qdGnWlKogIlXvyutP SetlFRUivg4Gv7tKs3iy6vdxc2S2W0ho78f3+gt25Tmq8/UanKMra0yqbcZNIh4GcnkZ 5VE1gDw6Y1mgs2pmNIVLT+0JqMEMPQZRCm1PgRNI3gLyXtelTDfOCuLt/kAtoaWYCnQG frv17HBKUlnq/7l6PzxzR9t0MiD3nRlzcZibL0PgJNiN2M2FNAyDTPJjRXvVynuvgWtN cdAmsNmo2ZL8mdvTD1Pt956uhTRf0/nwkWkGSgxuN6LREroDYdhCLxDfsN+ycTJCh+w/ tIDg== 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 c65si4699650pfa.82.2018.04.13.07.53.33; Fri, 13 Apr 2018 07:53:46 -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 S1752280AbeDMO2Z (ORCPT + 99 others); Fri, 13 Apr 2018 10:28:25 -0400 Received: from mx2.suse.de ([195.135.220.15]:55369 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751918AbeDMO2Y (ORCPT ); Fri, 13 Apr 2018 10:28:24 -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 D51F6AEDA; Fri, 13 Apr 2018 14:28:22 +0000 (UTC) Date: Fri, 13 Apr 2018 16:28:21 +0200 From: Michal Hocko To: Vlastimil Babka Cc: Minchan Kim , 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: <20180413142821.GW17484@dhcp22.suse.cz> References: <20180305133743.12746-1-guro@fb.com> <20180305133743.12746-5-guro@fb.com> <20180413133519.GA213834@rodete-laptop-imager.corp.google.com> <20180413135923.GT17484@dhcp22.suse.cz> <13f1f5b5-f3f8-956c-145a-4641fb996048@suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <13f1f5b5-f3f8-956c-145a-4641fb996048@suse.cz> 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 16:20:00, Vlastimil Babka wrote: > On 04/13/2018 03:59 PM, Michal Hocko wrote: > > 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. > > We would need kmalloc-reclaimable-X variants. It could be worth it, > especially if we find more similar usages. I suspect they would be more > useful than the existing dma-kmalloc-X :) I am still not sure why __GFP_RECLAIMABLE cannot be made work as expected and account slab pages as SLAB_RECLAIMABLE -- Michal Hocko SUSE Labs