From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 29319C433FE for ; Thu, 7 Oct 2021 07:27:49 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 8A430610FB for ; Thu, 7 Oct 2021 07:27:48 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 8A430610FB Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id E8B776B006C; Thu, 7 Oct 2021 03:27:47 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id E3C0A6B0071; Thu, 7 Oct 2021 03:27:47 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id D03A96B0073; Thu, 7 Oct 2021 03:27:47 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0044.hostedemail.com [216.40.44.44]) by kanga.kvack.org (Postfix) with ESMTP id C04A16B006C for ; Thu, 7 Oct 2021 03:27:47 -0400 (EDT) Received: from smtpin01.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 7B53731ED6 for ; Thu, 7 Oct 2021 07:27:47 +0000 (UTC) X-FDA: 78668811774.01.BDB6AD4 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by imf22.hostedemail.com (Postfix) with ESMTP id 087512DAB for ; Thu, 7 Oct 2021 07:27:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1633591666; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Ry165nxVbeeGg5gTu6DIc5396l+Gq9PRR2heRwKdlqs=; b=TCyyy4VQCQFlXOnjyDdAJnoE0cLCxPILaNmSI8yDMCYOtUXkqB+EtCNLHrcNfX6THwCRN/ uqNf5iG+T4blT7gQuCo93Jej04IWX5YfIEfCxI9/FEi4g7m0oG4Yj1NnWWTRRQKh7xsieC Y90D+nEnIQxFlomyjfJJW+d4HiJQ0aM= Received: from mail-wr1-f69.google.com (mail-wr1-f69.google.com [209.85.221.69]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-583-7LSZHS6CNbWUUar8NNSIWw-1; Thu, 07 Oct 2021 03:27:43 -0400 X-MC-Unique: 7LSZHS6CNbWUUar8NNSIWw-1 Received: by mail-wr1-f69.google.com with SMTP id 41-20020adf812c000000b00160dfbfe1a2so264162wrm.3 for ; Thu, 07 Oct 2021 00:27:43 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:subject:to:cc:references:from:organization :message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=Ry165nxVbeeGg5gTu6DIc5396l+Gq9PRR2heRwKdlqs=; b=jbn6FAgAh/5oo8MZwBVlI/lUWX2uK81a29AUJrGb60DlvrO4e8WaGL43XjktsGKibz zjyEMLlzHZkPowiOPnXfepQHSYYxLRjoz6VZneWA1GDAFgUSEr/LMNTOiOBSW6+s5AJa 9ByfHBFhQt8vClAJTWZwYh9UiFbOC5uy4BAF0RHyWj9EWgtxFuWPmfYheFpCiu7nmfB7 0aUfyMIepzW/dviYBd7YxUQ2tX2eNH00ijYDIiz+OWkpt4lXFeBUsBaCaw7TyucUKz6d LRTKLH5VCLL0ldELTZ2hqx6vJdhTg0pI5ujO1WJ92qSYqxnPef0fV3s8HTqizdrbi/jW t3sA== X-Gm-Message-State: AOAM533LnbaxH31HFLkrWJ9CbX9SQaNCKhtF6maui8MdL877rGffC2JF 06nuncvXMhgWQGylERGfEgaXUJqKtH58eWDD2V3CtvFeahY+Q5snhNOWoXzxbxqkd+wqJAJlHnp kPKcJr7qHNwQ= X-Received: by 2002:a7b:cc88:: with SMTP id p8mr2933849wma.101.1633591662025; Thu, 07 Oct 2021 00:27:42 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyfPPQ0UhVVfB2g4Qm80BYGgXuhoWg2b+qdl06xZYcuNFTPFP6YKFU3oUjgAf+DGohOTWKv8Q== X-Received: by 2002:a7b:cc88:: with SMTP id p8mr2933796wma.101.1633591661824; Thu, 07 Oct 2021 00:27:41 -0700 (PDT) Received: from [192.168.3.132] (p5b0c6886.dip0.t-ipconnect.de. [91.12.104.134]) by smtp.gmail.com with ESMTPSA id s14sm949540wro.76.2021.10.07.00.27.39 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 07 Oct 2021 00:27:41 -0700 (PDT) Subject: Re: [PATCH v10 3/3] mm: add anonymous vma name refcounting To: Suren Baghdasaryan , Andrew Morton Cc: Michal Hocko , John Hubbard , Pavel Machek , 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 , 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 , Tim Murray References: <20211001205657.815551-1-surenb@google.com> <20211001205657.815551-3-surenb@google.com> <20211005184211.GA19804@duo.ucw.cz> <20211005200411.GB19804@duo.ucw.cz> <6b15c682-72eb-724d-bc43-36ae6b79b91a@redhat.com> <192438ab-a095-d441-6843-432fbbb8e38a@redhat.com> <20211006192927.f7a735f1afe4182bf4693838@linux-foundation.org> <20211006195342.0503b3a3cbcd2c3c3417df46@linux-foundation.org> From: David Hildenbrand Organization: Red Hat Message-ID: <3645f74d-54b4-9223-1d53-75cade471fad@redhat.com> Date: Thu, 7 Oct 2021 09:27:39 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Server: rspam03 X-Rspamd-Queue-Id: 087512DAB X-Stat-Signature: xpnin89proyh5ky1yzds1d66z6ceans4 Authentication-Results: imf22.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=TCyyy4VQ; dmarc=pass (policy=none) header.from=redhat.com; spf=none (imf22.hostedemail.com: domain of david@redhat.com has no SPF policy when checking 216.205.24.124) smtp.mailfrom=david@redhat.com X-HE-Tag: 1633591666-844048 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On 07.10.21 05:01, Suren Baghdasaryan wrote: > On Wed, Oct 6, 2021 at 7:53 PM Andrew Morton wrote: >> >> On Wed, 6 Oct 2021 19:46:57 -0700 Suren Baghdasaryan wrote: >> >>>>>>> I wish it was that simple and for some names like [anon:.bss] or >>>>>>> [anon:dalvik-zygote space] reserving a unique id would work, however >>>>>>> some names like [anon:dalvik-/system/framework/boot-core-icu4j.art] >>>>>>> are generated dynamically at runtime and include package name. >>>>>> >>>>>> Valuable information >>>>> >>>>> Yeah, I should have described it clearer the first time around. >>>> >>>> If it gets this fancy then the 80 char limit is likely to become a >>>> significant limitation and the choice should be explained & justified. >>>> >>>> Why not 97? 1034? Why not just strndup_user() and be done with it? >>> >>> The original patch from 8 years ago used 256 as the limit but Rasmus >>> argued that the string content should be human-readable, so 80 chars >>> seems to be a reasonable limit (see: >>> https://lore.kernel.org/all/d8619a98-2380-ca96-001e-60fe9c6204a6@rasmusvillemoes.dk), >>> which makes sense to me. We should be able to handle the 80 char limit >>> by trimming it before calling prctl(). >> >> What's the downside to making it unlimited? > > If we ignore the human-readability argument, I guess the possibility > of abuse and increased memory consumption? I'm guessing parsing such a > string is also easier if there is a known limit? 64k * 80 bytes already makes me nervous enough :) -- Thanks, David / dhildenb