Received: by 2002:a25:31c3:0:0:0:0:0 with SMTP id x186csp959733ybx; Thu, 7 Nov 2019 05:17:04 -0800 (PST) X-Google-Smtp-Source: APXvYqzIKCk081ka202XD3iAqDkIMy9zHyw41B/9GUg67s/4B+ldj6twCycYZsEkr54w71ml2pjw X-Received: by 2002:a17:907:384:: with SMTP id ss4mr948820ejb.132.1573132624389; Thu, 07 Nov 2019 05:17:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573132624; cv=none; d=google.com; s=arc-20160816; b=yZtPfgZ4YofUYwnlJcAwaZnwfFmDjceEh2tj5MQ1vORGQlTg38+5BewDXbvb+XW0gK AxhkqNyYnN+In4U6oxylyWEnl3PkOOwKhnSVM9JZ/43xJJoZrsw3YBn2f4uCt+0Z3wiC 8WeC1Isv+8Ccj4/dD+K5PUQEO6ydgNkYTuunAkVWCS+7Sne8RuOP9njEpZQD0l00wYrh cmjKFbv1wh6J1EdI3HhTPotqFKtc3MZNjlMnRUqBfY1x6ddywsDKwA5XNm7xdY/9L1tU a/OdvIXSAk7Crlx+wNQ6HXRpi6z15eyiQEGnxj8S3tuVn5w7VLQvRU299qinqEU4ymbH Pawg== 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; bh=W+yQv73StizsfWe2grdqPjWG1oNw2/EYHqU14rb7Lj4=; b=hn2rM8QGDCLQyQAw5ZAd71S7LtobwyeHg+gdeTAvaUg5NUlKX14NwUwWPgSwevChyh 7xoQhXsgGkPm6A9o2M66yHvuj5qiRWNh5HshPEo3NFIOBi97w2B//lPhybQu5gnvQkFi RDbmVJOs4b5GSg7t8o8MPZuB1TRM9jOvK2KEy28rWnMxpEdbqmuJ6D98pXKVUJMySNss Asdbk/j8WyR/DDfcjsMhdxfTK0AuXtcH6/xqdsrgc7HKeG1eV3ukfiQf8TXL+HoTSLoQ td8LoZIUXCJeZ/UWXSpuc3lnFUCgLmKeDE+jx+KYOZB92hzzNkOAjRO5XJXm8jlMiASX Ahog== 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=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f21si1427151ede.253.2019.11.07.05.16.41; Thu, 07 Nov 2019 05:17:04 -0800 (PST) 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388931AbfKGNNq (ORCPT + 99 others); Thu, 7 Nov 2019 08:13:46 -0500 Received: from mx2.suse.de ([195.135.220.15]:57766 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727619AbfKGNNp (ORCPT ); Thu, 7 Nov 2019 08:13:45 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id CB4B9B169; Thu, 7 Nov 2019 13:13:43 +0000 (UTC) Date: Thu, 7 Nov 2019 14:13:42 +0100 From: Michal Hocko To: Knut Omang Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, Christoph Lameter , Pekka Enberg , David Rientjes , Joonsoo Kim , Andrew Morton Subject: Re: [PATCH] mm: provide interface for retrieving kmem_cache name Message-ID: <20191107131342.GT8314@dhcp22.suse.cz> References: <20191107115404.3030723-1-knut.omang@oracle.com> <20191107115806.GP8314@dhcp22.suse.cz> <27006f47b0b85fb99acee2a638207268aef8d010.camel@oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <27006f47b0b85fb99acee2a638207268aef8d010.camel@oracle.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu 07-11-19 13:26:09, Knut Omang wrote: > On Thu, 2019-11-07 at 12:58 +0100, Michal Hocko wrote: > > On Thu 07-11-19 12:54:04, Knut Omang wrote: > > > With the restructuring done in commit 9adeaa226988 > > > ("mm, slab: move memcg_cache_params structure to mm/slab.h") > > > > > > it is no longer possible for code external to mm to access > > > the name of a kmem_cache as struct kmem_cache has effectively become > > > opaque. Having access to the cache name is helpful to kernel testing > > > infrastructure. > > > > > > Expose a new function kmem_cache_name to mitigate that. > > > > Who is going to use that symbol? It is preferred that a user is added in > > the same patch as the newly added symbol. > > Yes, I am aware that that's the normal practice, > we're currently using cache->name directly in the kernel > unit test framework KTF (https://github.com/oracle/ktf/) > which we are working (https://lkml.org/lkml/2019/8/13/111) to get > into the kernel in one form or another. Please add the export with a patch that really needs it. > To me this seems like a natural part of an API for the kmem_cache > data structure now that it has in effect become opaque, so it seemed > appropriate to get it in close in time to the patch that no longer > makes this possible, instead of someone else hitting this down the road. Well, this is something for SLAB maintainers but I do not really think the name is something the in kernel code should care about. It is solely for presenting reasonable statistics to the userspace and that code workds just fine AFAIK. -- Michal Hocko SUSE Labs