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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4BB29C433EF for ; Thu, 24 Feb 2022 23:23:05 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id AC5A18D0005; Thu, 24 Feb 2022 18:23:04 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id A75C28D0001; Thu, 24 Feb 2022 18:23:04 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 98B878D0005; Thu, 24 Feb 2022 18:23:04 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (relay.hostedemail.com [64.99.140.25]) by kanga.kvack.org (Postfix) with ESMTP id 87BFF8D0001 for ; Thu, 24 Feb 2022 18:23:04 -0500 (EST) Received: from smtpin09.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id 4670523B68 for ; Thu, 24 Feb 2022 23:23:04 +0000 (UTC) X-FDA: 79179251088.09.788E295 Received: from mail-yw1-f169.google.com (mail-yw1-f169.google.com [209.85.128.169]) by imf17.hostedemail.com (Postfix) with ESMTP id C902940008 for ; Thu, 24 Feb 2022 23:23:02 +0000 (UTC) Received: by mail-yw1-f169.google.com with SMTP id 00721157ae682-2d66f95f1d1so16080837b3.0 for ; Thu, 24 Feb 2022 15:23:02 -0800 (PST) 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=7PcHeGTv1nepIZccoOt2KvIGv6o7ZMesEHiNR2b+Ae4=; b=IP46SqaFG3Cp9I/RlUmTy2NwIuXAD+TIu4+nLuhN3cPPcmtXjuhdH01Z7ACwrjUMSt +wtYp5sdxZOO554Itx7519khz8U5Jmu9oHjtpoqzTsPYYBl6A3XdGyZOxZO/AKNeCTTn kwhUGYIhUxJsDbhwnuN99mUTY+TNCUhxolMzT+ZG5zS26PPXTVI7w8NkhfykOj4j7/3x rBlxWRSoh7ayE2EsjKW5ER6vLOQfvHymvYHnQ9nO/DLYrPllboC1H0nWsJbYxdae3WLR Tv8wiPuQkus5yqJCqF7wP6je0NrJC66k5KoqL3rOScpAcQWFlNzlDGerqw2ZHxm2LW8u 1AUg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=7PcHeGTv1nepIZccoOt2KvIGv6o7ZMesEHiNR2b+Ae4=; b=yGuw7jC8vb8yVTUJ/oLxDt0S9ZiT8TwcBIC27jj5tVYk17RxJauC0XpfIwl9phLYdR U0SKLoQoRja5/TvBdx+lOqmF1Lp80v0eX4wxjkL7T9Zbvs9wRLsa34SGmmf1YCgjE8Z4 67zDoRdelvIBe/0CNldue8Y/xQgyhy237sxLNS6Z1FQujphmv/dbqYD0Cu7lnalXE0Aq 7nopaJ8mPbL42kFP7K9n51+TdeiXVplf0/Qn+zFjt5yVq5FfcVcY6NufcOqhrtke5sDa yNnDCZziJ/Wx8CsvFb9NKqeVt913RDL0FRVuzNQDiuH6c3+TL2gHhSDORwtP320MFsCQ XviQ== X-Gm-Message-State: AOAM532YFnrrAdJRClj8vEmThyms0posQDLQM+zYCOWJwzmnUEibx6eW 0kmSLnfFzLCG98w2TnDZA7+gxjbnwqhvTKktiJrRpA== X-Google-Smtp-Source: ABdhPJySf8IPuVlilt1gPELukIw7azFXE1n/f504LYGPRJS3bICswx2L2GLT5H0iEOkcI/XpiLE3qfsFdpPXZeA/yCU= X-Received: by 2002:a81:1748:0:b0:2d6:41ae:1384 with SMTP id 69-20020a811748000000b002d641ae1384mr4902300ywx.293.1645744981753; Thu, 24 Feb 2022 15:23:01 -0800 (PST) MIME-Version: 1.0 References: <20220223153613.835563-1-surenb@google.com> In-Reply-To: From: Suren Baghdasaryan Date: Thu, 24 Feb 2022 15:22:50 -0800 Message-ID: Subject: Re: [PATCH v2 1/3] mm: refactor vm_area_struct::anon_vma_name usage code To: Michal Hocko Cc: akpm@linux-foundation.org, ccross@google.com, sumit.semwal@linaro.org, dave.hansen@intel.com, keescook@chromium.org, willy@infradead.org, kirill.shutemov@linux.intel.com, vbabka@suse.cz, hannes@cmpxchg.org, ebiederm@xmission.com, brauner@kernel.org, legion@kernel.org, ran.xiaokai@zte.com.cn, sashal@kernel.org, chris.hyser@oracle.com, dave@stgolabs.net, pcc@google.com, caoxiaofeng@yulong.com, david@redhat.com, gorcunov@gmail.com, linux-mm@kvack.org, linux-kernel@vger.kernel.org, kernel-team@android.com Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: C902940008 X-Stat-Signature: 4tacfrzmodk1oqxd9xwun53pp4hi8ykn X-Rspam-User: Authentication-Results: imf17.hostedemail.com; dkim=pass header.d=google.com header.s=20210112 header.b=IP46SqaF; spf=pass (imf17.hostedemail.com: domain of surenb@google.com designates 209.85.128.169 as permitted sender) smtp.mailfrom=surenb@google.com; dmarc=pass (policy=reject) header.from=google.com X-Rspamd-Server: rspam05 X-HE-Tag: 1645744982-887408 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 Thu, Feb 24, 2022 at 12:36 AM Michal Hocko wrote: > > On Wed 23-02-22 07:36:11, Suren Baghdasaryan wrote: > > Avoid mixing strings and their anon_vma_name referenced pointers > > by using struct anon_vma_name whenever possible. This simplifies > > the code and allows easier sharing of anon_vma_name structures when > > they represent the same name. > > > > Suggested-by: Matthew Wilcox > > Suggested-by: Michal Hocko > > Signed-off-by: Suren Baghdasaryan > > LGTM > Acked-by: Michal Hocko > > Thanks and one minor nit below Addressed all the nits in the next version: https://lore.kernel.org/all/20220224231834.1481408-1-surenb@google.com/ Thanks! > > [...] > > +static inline void free_anon_vma_name(struct vm_area_struct *vma) > > { > > - const char *vma_name = vma_anon_name(vma); > > + /* > > + * Not using anon_vma_name because it generates a warning if vma->vm_mm > > + * is not held, which might be the case here. > > s@vma->vm_mm@mmap_lock@ > > > + */ > > + if (!vma->vm_file) > > + anon_vma_name_put(vma->anon_name); > > +} > > > > - /* either both NULL, or pointers to same string */ > > - if (vma_name == name) > > -- > Michal Hocko > SUSE Labs