Received: by 2002:a05:6a10:eb17:0:0:0:0 with SMTP id hx23csp2951433pxb; Mon, 6 Sep 2021 08:55:54 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzLqj3FMrV2wyUl3w/FzOAwKiVby2saMroIDIZcbbWxMOOgz5TWQ5VQiF5G5SBIdCh+aLHb X-Received: by 2002:a17:906:c52:: with SMTP id t18mr14145117ejf.148.1630943754650; Mon, 06 Sep 2021 08:55:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1630943754; cv=none; d=google.com; s=arc-20160816; b=LgRZKzUaI0yAmyn9DR+Mw8ppdrByjJhhB4Mz9p5b9Pn7/E8cPMKhBm6U+hnjArxe+f PoWx7wGcA7aGwHLHm8ejFjX+9AKIVvbs3tc3RSuCEgc7T5ReIjvNiKAmdfB3RbQU4Jy7 SYTPN34Dl6HggjK2b8sEgxwzCsE83OthCcUiNWTEKJgvbQcFYQi6R2Snlpiy2Nb2cPxp WMi6JqsOVsuiCQG5KMpOLGIzzGcpJ3zmpdZPpnucJbiC34ADMImQnL+afeb+e3SLFhLl bH2poEkUOKV4Npk7gS5zFFnUcNVODbi1THs4wnHOQy336/n0qKo8tfo5Piz66O0yaLDr 5bVw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=/bgcmHKDn3LorkuSVcyCAc/MMYfBn+zOMCmk2ZUB6aM=; b=mJ4DngsOI0+sQRjEPvt4Z8bTpeXh27XD4kaYGoaPptPNg/M2UO5WSklTF6n62Dy7/W fxdH611s38iaBYYXcTVQp8UzmzUWhTncCu68p+s89ezSDp22fvT7ar16MZqQXE3VG4kO 1v7Ni7TUHkcQxNVnIPT3vjtrNG2w2wwIKpjMfo1K7uXlM1PN4kDVU/YwVe6XNDUb/7mf vjrMJSqYNQCSw2dYrPiG0HFHrAcdIuYcB0SbhTlQfnBCBIPJxunyyvd4xJHYC3b7Y7za v/P9S0pGBttkmcITkvbsORRLYJUTUnsfxR7JMu+XlZTJqlbA7/78nBWtzsLn8mvLRsp2 nGWQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=olm2PhGC; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id l12si7994444edr.509.2021.09.06.08.55.30; Mon, 06 Sep 2021 08:55:54 -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=@google.com header.s=20210112 header.b=olm2PhGC; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243386AbhIFPxk (ORCPT + 99 others); Mon, 6 Sep 2021 11:53:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51502 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243398AbhIFPxj (ORCPT ); Mon, 6 Sep 2021 11:53:39 -0400 Received: from mail-yb1-xb2b.google.com (mail-yb1-xb2b.google.com [IPv6:2607:f8b0:4864:20::b2b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 370A7C06175F for ; Mon, 6 Sep 2021 08:52:35 -0700 (PDT) Received: by mail-yb1-xb2b.google.com with SMTP id c6so14340752ybm.10 for ; Mon, 06 Sep 2021 08:52:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=/bgcmHKDn3LorkuSVcyCAc/MMYfBn+zOMCmk2ZUB6aM=; b=olm2PhGCTEx8jQKQDPim0F/G0tBroK7mfgYdUepqc+UelRqSX/GROVmY2M3UCa0lob Vljs4WXF/BrdWjVIYgzg4cHFZ5N3sLEb4jPJ8VHqmMqO0WIJ7jMdOvI7xve98ywgsEmk EJ+yoAt2Mwy2iuR9zQuXuWrMK5753BkiByyq7AqIO9hK2DPVV1IeUeZNeZ9AZ4W3GdHt Ys+bDqqEUpRXHYUH2HmtmAv4xb0GKy4kmP1/5emiSbc9kHoTUoanAAe7XrLQRbhDn5CA 8xhWkM+3BdIWs3T0IY3LbfaCLto0Jy/FxqN+q+PyMvj7bDJY5Gr7MuaL3DwjC39N8BLS h9Ew== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=/bgcmHKDn3LorkuSVcyCAc/MMYfBn+zOMCmk2ZUB6aM=; b=gFhAOu8No3a5br/glSR0/sxCueRsFb6sDE2Tw3AA/D4aITyvDvxQBWxfemn9Yr5A66 gxSCG7+hvZODlhxwqPL2nIrwzoeGjKM2lS00uwrmv+vt/w3Ts34V4EBT3f3OFpMXZvPX U4Dr531H6gumlTBXBUAwHGTlI2h9GJ4owhgoI2smPCFnFcNPC5NQ6drk5TlOb+mMW5Vm L4E5EyxWNeVSdNHGPDfUaocOZf6RiE52WcfHVKNz7wnZDwjJPGvyjI5sev9L2TSDY5go 0SI0C8RddbIycXLAK4NdQFWGo9Ap8QzAEfnJWcjuP7JDFgkZBGKQihpxBTx5P4dwpmQc /8Cg== X-Gm-Message-State: AOAM532IwLq7wFXPKUqjmqp/x31rFLqs64MUzBPG0dfux+Weox6uPf1S LLXOR82VTzVZgV/2xELIs7a2UMz0xla31UU/wjZP8Q== X-Received: by 2002:a25:b9c8:: with SMTP id y8mr18444413ybj.487.1630943554077; Mon, 06 Sep 2021 08:52:34 -0700 (PDT) MIME-Version: 1.0 References: <20210902231813.3597709-1-surenb@google.com> <20210902231813.3597709-2-surenb@google.com> <202109031420.2F17A2C9@keescook> <20210905130418.GA7117@localhost> In-Reply-To: <20210905130418.GA7117@localhost> From: Suren Baghdasaryan Date: Mon, 6 Sep 2021 08:52:23 -0700 Message-ID: Subject: Re: [PATCH v9 2/3] mm: add a field to store names for private anonymous memory To: Pavel Machek Cc: Kees Cook , Andrew Morton , Colin Cross , Sumit Semwal , Michal Hocko , Dave Hansen , 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, =?UTF-8?B?Q2hpbndlbiBDaGFuZyAo5by16Yym5paHKQ==?= , Axel Rasmussen , Andrea Arcangeli , Jann Horn , apopple@nvidia.com, John Hubbard , 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@oracle.com, 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 Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Sep 5, 2021 at 6:04 AM Pavel Machek wrote: > > Hi! > > > > the process is still running, so it has to have some sort of > > > synchronization with every layer of userspace. Efficiently tracking > > > the ranges requires reimplementing something like the kernel vma > > > trees, and linking to it from every layer of userspace. It requires > > > more memory, more syscalls, more runtime cost, and more complexity to > > > separately track regions that the kernel is already tracking. > > Ok so far. > > > > This patch adds a field to /proc/pid/maps and /proc/pid/smaps to show a > > > userspace-provided name for anonymous vmas. The names of named anonymous > > > vmas are shown in /proc/pid/maps and /proc/pid/smaps as [anon:]. > > > > > > Userspace can set the name for a region of memory by calling > > > prctl(PR_SET_VMA, PR_SET_VMA_ANON_NAME, start, len, (unsigned > > > long)name); > > Would setting a 64-bit integer instead of name be enough? Even if > each party would set it randomly, risk of collisions would be very > low... and we'd not have to deal with strings in kernel. Thanks for the question, Pavel. I believe this was discussed in this thread before and Colin provided the explanation with usage examples: https://lore.kernel.org/linux-mm/20200821070552.GW2074@grain/. Thanks, Suren. > > Pavel > > > -- > > -- > To unsubscribe from this group and stop receiving emails from it, send an email to kernel-team+unsubscribe@android.com. >