Received: by 2002:a05:6a10:d5a5:0:0:0:0 with SMTP id gn37csp1121641pxb; Thu, 7 Oct 2021 00:55:34 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzH75fqUZuEc810lksh8/SUkIlWIfKED11r+UsQHSHq22pt3omR0EzH781/arV2F8pqyAVC X-Received: by 2002:a05:6402:3483:: with SMTP id v3mr2173330edc.296.1633593333991; Thu, 07 Oct 2021 00:55:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633593333; cv=none; d=google.com; s=arc-20160816; b=xaADCuKPFgFKdV1jUdbRe9jQeEsQEHJwRiOBjvoye3kn5CDZLnC8zPau1upHg8aPBz PGnQbbjxgMu7NI1R7KPwfRyNNfn6DtpGK57oy+/rNJxyLICZoNSZ7oG2WNb9X8qqSUdQ 89kYBOv0d9jP/+mHvA7myS/CFHaIDcQustc/XF5fl6B364DDold4wZKYItkVdef3Hqjc wIzuuiKbiGqPYJL0DOuC7hqQBB0grl01I+xrIwIlR46iAN7RST2kpf2AVwbsBYCrItI0 diQa1mrGZj5k5G/DApneh/AvkhPbialip78E/ZBlDM5zfh1ZGRF5iTXdVe7czRUZmMfk jB8Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:organization :from:references:cc:to:subject:dkim-signature; bh=Ry165nxVbeeGg5gTu6DIc5396l+Gq9PRR2heRwKdlqs=; b=nGgfj/p22HNBPYq2StYWAsXN912LkCBPIwnAbqRkvf4YcULgKL/7WFaPhvtEfgF5mz xAveYUH8jWfDxjdZbV+Y9z43tqIeNtKqIC6D4V+AwGLNfKX0VX9Xm/YmTpdZLh8N6NrX CUDRvzerAtUWF9DEChS6xCKDrqgvQLX2IVh9hLxNDjgF8nXawa+9d73VbmhdFtVyZojn EHdrM3/26W04F+cuojokUQf3XXYaBu0p+T5Afl6g4iMlmaMyPy5GNyWWaiLrya982ApH 0ls7IT86O1gZFaVCxEcjjtfAOMK66CVzsQzKmHlcc6NMPfIlagoKaZMKrrbXBRsJZMgs tzNQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=F2J6UvJk; 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=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id z19si3843726edd.333.2021.10.07.00.55.10; Thu, 07 Oct 2021 00:55:33 -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=@redhat.com header.s=mimecast20190719 header.b=F2J6UvJk; 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=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232502AbhJGH3j (ORCPT + 99 others); Thu, 7 Oct 2021 03:29:39 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:38880 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232512AbhJGH3h (ORCPT ); Thu, 7 Oct 2021 03:29:37 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1633591664; 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=F2J6UvJkfj+oqG5/Uwe1EC5RPoE4uYjF7uxgzlZzSDBrl21o2Gtp5meJQ/fqeaeqDy34eL /iiOAUUD81j1HeKTcEkb/FtExz7et7GPHvH9L6AVlcX7oG+wPsrQhWvryh2ZOidBSfKsw6 6F22n8LRnZ+vYeDJqnikzWxt9q/rajE= Received: from mail-wr1-f72.google.com (mail-wr1-f72.google.com [209.85.221.72]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-254-MGFEo8tlPN63Cfo_A6El0w-1; Thu, 07 Oct 2021 03:27:43 -0400 X-MC-Unique: MGFEo8tlPN63Cfo_A6El0w-1 Received: by mail-wr1-f72.google.com with SMTP id p12-20020adfc38c000000b00160d6a7e293so1444491wrf.18 for ; Thu, 07 Oct 2021 00:27:42 -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=zDNqU1aQg8zk3QJ0tvxRGv/amTKM2va7s03/25zQnSDCmvwZeVGxfUmjGeLEoflhnQ IIrbgePkNj6mqI6/vV+A5FT8ti6vs75KsMRK78mwsMPlD/YFrRET1nQ99dfCZHXBLlGo JuckfqP51dNmCO57yZzbG11oa5YPQHfyiq6Kbe/HKWyPC/VgNaC/MMOJesYlLs2J/jlW NigZSnXINVRHL15s6ellrCELirqAj2hNo2alGc21eymb520JCaCToWSRxHCfN7Ld552F elwT/dWNXhC7qcTTSzIjSiYYzZ0L+pavKGK9wGZoB1RQvVPfAk7/8uhcMNGEcTakW1y2 WyEA== X-Gm-Message-State: AOAM532oyrLO2iAKsZk2TbxwzgbAHi09tXdhFUNNo0w11YlXOVc1xRdr U/1SxGAO7y6STfX0F80s0TeMzMDMss6V2cDyaHXtun7fzW156uxxycgbPtDoVwRfdVNjrAOWdhv OfXfhaJ+CKbvF2RYGmIFosq+F X-Received: by 2002:a7b:cc88:: with SMTP id p8mr2933848wma.101.1633591662024; Thu, 07 Oct 2021 00:27:42 -0700 (PDT) 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: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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