Received: by 2002:a05:6a10:d5a5:0:0:0:0 with SMTP id gn37csp1189923pxb; Thu, 7 Oct 2021 02:42:53 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw0+VDxCGlestgR0ynOufvNkmL+1avMNTDpDWSaz1tpl6WGYGCXPnpC1dWpQwO8XAzMDI5r X-Received: by 2002:a17:90a:4a04:: with SMTP id e4mr3661692pjh.51.1633599773630; Thu, 07 Oct 2021 02:42:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633599773; cv=none; d=google.com; s=arc-20160816; b=K2SbOIe1s6aJNbJZ6872nozE17IVmGdU97tFfM86UmNzW32mRqw28CgFt5mh7aeIyV ddWcTMG7RX88KDAvDZvs5P4m+xd+Qv1/B1hNji8gRgxjuUOWPRR9OKjJIM3fRCkRBKyy GJLzTPlUuf0VDvwxGpJvMMBO6miaYz3SXuK4HBd8cIdQgvoRwXQjysTP4j6RvhjXwsjV A/ewPoiUQbCpdyzCoPZ4TTPhyVVkJ9sjz3xBs69ItXhDwFQzWqyn+7KYjnnDeCGwDpII 7Tq/K6cyl7YGn91jns01AM/Mn/pgMDElLxmDNnCFkvZkXYdFP9gWb5xH4aHFXt9Zk1ym NHeg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=Oc55QYscnPdKzwCjb0ywVfd/doUxkdVcTeLmeqISr7o=; b=t/B5N2gyrBap3AhoeE8cznB+pC6q/gf51F3nPXexFdv28rWFpZj5Uo6ExgUGhE4QNs U+v3O9eUjmouFLBYJ3gxWFJU+6fdxOEEusRKoCD3HDs+E+hr0EHpLHICWTnle4jN3EVK lLz+Vyy1MCEtd6Qc06ZxSRSdoSg/Y5FlLBg8bvRidXTdnDlXiBACgaF8s1SauJ9xjp1n XyL+cyzTYhj4OuSjae3afpjCKgjTgG/eHVFoRJBxSDvw1KFHc3wFoBsyDeZg9eXr+DoK kuXducz2N9aqz4RcNv53SXm8bWojDCrmBTcudsj8b4Ng6/WRRXCYBI+Twudzceub3HiS FTcg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b=M+pb6kZB; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=suse.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y14si4607751pfa.311.2021.10.07.02.42.39; Thu, 07 Oct 2021 02:42:53 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b=M+pb6kZB; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=suse.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240633AbhJGIMy (ORCPT + 99 others); Thu, 7 Oct 2021 04:12:54 -0400 Received: from smtp-out2.suse.de ([195.135.220.29]:51312 "EHLO smtp-out2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240554AbhJGIMx (ORCPT ); Thu, 7 Oct 2021 04:12:53 -0400 Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out2.suse.de (Postfix) with ESMTP id E76371FF49; Thu, 7 Oct 2021 08:10:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1633594259; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=Oc55QYscnPdKzwCjb0ywVfd/doUxkdVcTeLmeqISr7o=; b=M+pb6kZBKTijfupuQci9zI0JzzADDVtW/KDSipGnsBgM01o/2Zfd8Zf2qDwIDRzPapNAPw C/a15erqzs5+/vNjqXtbDZovG90WNGdDWv3/UjXvA8ptySXIDaLgqT+N+M30EdJqu5Rni2 QHhYCD82KKUdf/uvulrMMidepD6Q69c= Received: from suse.cz (unknown [10.100.201.86]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by relay2.suse.de (Postfix) with ESMTPS id 43D35A3B85; Thu, 7 Oct 2021 08:10:59 +0000 (UTC) Date: Thu, 7 Oct 2021 10:10:58 +0200 From: Michal Hocko To: Suren Baghdasaryan Cc: Pavel Machek , David Hildenbrand , John Hubbard , Andrew Morton , Colin Cross , Sumit Semwal , Dave Hansen , Kees Cook , Matthew Wilcox , "Kirill A . Shutemov" , Vlastimil Babka , Johannes Weiner , Jonathan Corbet , Al Viro , Randy Dunlap , Kalesh Singh , Peter Xu , rppt@kernel.org, Peter Zijlstra , Catalin Marinas , vincenzo.frascino@arm.com, Chinwen Chang =?utf-8?B?KOW8temMpuaWhyk=?= , Axel Rasmussen , Andrea Arcangeli , Jann Horn , apopple@nvidia.com, Yu Zhao , Will Deacon , fenghua.yu@intel.com, thunder.leizhen@huawei.com, Hugh Dickins , feng.tang@intel.com, Jason Gunthorpe , Roman Gushchin , Thomas Gleixner , krisman@collabora.com, Chris Hyser , Peter Collingbourne , "Eric W. Biederman" , Jens Axboe , legion@kernel.org, Rolf Eike Beer , Cyrill Gorcunov , Muchun Song , Viresh Kumar , Thomas Cedeno , sashal@kernel.org, cxfcosmos@gmail.com, Rasmus Villemoes , LKML , linux-fsdevel@vger.kernel.org, linux-doc@vger.kernel.org, linux-mm , kernel-team Subject: Re: [PATCH v10 3/3] mm: add anonymous vma name refcounting Message-ID: References: <20211005184211.GA19804@duo.ucw.cz> <20211005200411.GB19804@duo.ucw.cz> <6b15c682-72eb-724d-bc43-36ae6b79b91a@redhat.com> <20211006175821.GA1941@duo.ucw.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed 06-10-21 11:18:31, Suren Baghdasaryan wrote: > On Wed, Oct 6, 2021 at 10:58 AM Pavel Machek wrote: [...] > > That "central facility" option can be as simple as "mkdir > > /somewhere/sanitized_id", using inode numbers for example. You don't > > really need IPC. > > Hmm, so the suggestion is to have some directory which contains files > representing IDs, each containing the string name of the associated > vma? Then let's say we are creating a new VMA and want to name it. We > would have to scan that directory, check all files and see if any of > them contain the name we want to reuse the same ID. I believe Pavel meant something as simple as $ YOUR_FILE=$YOUR_IDS_DIR/my_string_name $ touch $YOUR_FILE $ stat -c %i $YOUR_FILE YOUR_IDS_DIR can live on a tmpfs and you can even implement a policy on top of that (who can generate new ids, gurantee uniqness etc...). The above is certainly not for free of course but if you really need a system wide consistency when using names then you need some sort of central authority. How you implement that is not all that important but I do not think we want to handle that in the kernel. -- Michal Hocko SUSE Labs