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 1C686D1D88B for ; Tue, 15 Oct 2024 16:26:40 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 69DEB6B0082; Tue, 15 Oct 2024 12:26:39 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 64DB86B0083; Tue, 15 Oct 2024 12:26:39 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 514AD6B0085; Tue, 15 Oct 2024 12:26:39 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id 2FACA6B0082 for ; Tue, 15 Oct 2024 12:26:39 -0400 (EDT) Received: from smtpin04.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id C320A807A2 for ; Tue, 15 Oct 2024 16:26:30 +0000 (UTC) X-FDA: 82676364750.04.1BD73C8 Received: from mail-qt1-f181.google.com (mail-qt1-f181.google.com [209.85.160.181]) by imf10.hostedemail.com (Postfix) with ESMTP id 37731C0006 for ; Tue, 15 Oct 2024 16:26:33 +0000 (UTC) Authentication-Results: imf10.hostedemail.com; dkim=pass header.d=google.com header.s=20230601 header.b=phoGi5rY; dmarc=pass (policy=reject) header.from=google.com; spf=pass (imf10.hostedemail.com: domain of surenb@google.com designates 209.85.160.181 as permitted sender) smtp.mailfrom=surenb@google.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1729009549; a=rsa-sha256; cv=none; b=Z21rLhSEtZSO3xSNstiaKCZKxMohiwZzb/edxS3sdO+f+pAapztBMtqXi+LTWSxTLcLL4c BrdJHjYOl8FMDw3qROwZCz1nt/vOLRbNP6RSp79A9cJXd+TS04M/bLdsDrVNU9+KRD/zZL rgSKPXa6dUcRQbJxJLY9msT4njLDd30= ARC-Authentication-Results: i=1; imf10.hostedemail.com; dkim=pass header.d=google.com header.s=20230601 header.b=phoGi5rY; dmarc=pass (policy=reject) header.from=google.com; spf=pass (imf10.hostedemail.com: domain of surenb@google.com designates 209.85.160.181 as permitted sender) smtp.mailfrom=surenb@google.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1729009549; h=from:from:sender: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:dkim-signature; bh=ByNOtnqk52ePIj5atFjVP7CCcQ9LOwoYrSe4G9dfPzk=; b=LswNeGj5yrv8518m1LBOfwc8eHu3lR0PRCRCj/CAq6D2ozoJssYL8cLB68wLHcYUThvgGu 96W5rH3FD+dw0t0fjgVCG1Cr5OOW/oKgW/A1CaSyREfUgu0W8sHak3zYWOpBFwTBxiQSZo RCpVBo1KArjdlFFJxxsnusbN8+6XAF0= Received: by mail-qt1-f181.google.com with SMTP id d75a77b69052e-460395fb1acso793521cf.0 for ; Tue, 15 Oct 2024 09:26:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1729009596; x=1729614396; darn=kvack.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=ByNOtnqk52ePIj5atFjVP7CCcQ9LOwoYrSe4G9dfPzk=; b=phoGi5rYfkEvqkkQnInSOAcunq5qh60yKk42ziYDaLTQxTR1bVrCAuDGXYU68MzixS 7bfjA/a9XKKWHls52v7bxHRQxA7lVdgfM0R+K9EyJlN/ip0ZhVebEH/5bJQF0NzLBmrX t0+rDYwbv0XFq+tq+69hCjru8+oAyTResLI1rcsEzcxwsnrjPOomYlbGWvcU/zPR73le wPlYbROFJt1CUewYFeZkO5K85SbIqTKgwTcMbYDKnHlRAldJ6RGYbxJm3ZsnJf87orF8 iK7bahW/PjsVPEA4vLF+UbfX+TtHjd/9GWyywagcJXupDMYhlEicThVVbLfXjO5CyD84 7/Sg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1729009596; x=1729614396; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ByNOtnqk52ePIj5atFjVP7CCcQ9LOwoYrSe4G9dfPzk=; b=msq8NlS1VbcaUlh0TexrufOWrMsO9BY+rDCC/1xWC006MOmsDaqrNDgoiLvKnl+BAK urQ9GQhc4oWSZxf0guHOFFkAuCqTipQ0GbMifXU1Vc/PHmVnKg1uPJAFkL2voF6tXlNZ fEVjwM/kRvQvRgyfrNxvJ6j/I+DLibZsa+PB+tYMovXsAq4h4+ubaTRjjd71fZZkhoQQ +ob37K5RjmtlbtMxX8IaBh/OWcN1TqnJIkD6WtsFMU1xqjUgAtkgFtq1l1vMdmrqMeCg ueykG300tHjPlLR4cVcOqRrJAbWNFTZKWO4atXpVaV+JewEnJ4llSxkzyLcDTgSAaN3x jU6Q== X-Forwarded-Encrypted: i=1; AJvYcCXF7dwZq9MJaJFJWECdBi0HgHlVSfMu7gHLw4Xq4kVq5/01TPPvdfrsKGFACMbs0iD/LwUKaHQeAg==@kvack.org X-Gm-Message-State: AOJu0YxambaodZe0l2awEYMlhwYkVmbTpc9T+OmoYTMNga/Fr5wI0cdL 6HcVn6sfi+kzJ9BkcwksrbR5oGbbKJ5fCa/ObREY8mlA6fzYQuIi7/g2enmgm44S4QxJ2lDEsmN mQYssMUrQm5h2sVex7Vr1STBf+vHpLh5v0tvZ X-Google-Smtp-Source: AGHT+IEJf/zEbvfRLlUBkavHUP4hlRMi5TuBiNYWQTdXNa6kRDfahgq4f8DAV0x/WUWXlEXeRgomzUcU5kxGSCng7Vk= X-Received: by 2002:a05:622a:848e:b0:458:17ac:2913 with SMTP id d75a77b69052e-46059c43d71mr9480531cf.11.1729009595317; Tue, 15 Oct 2024 09:26:35 -0700 (PDT) MIME-Version: 1.0 References: <20241014203646.1952505-1-surenb@google.com> <20241014163231.9ef058c82de8a6073b3edfdc@linux-foundation.org> In-Reply-To: From: Suren Baghdasaryan Date: Tue, 15 Oct 2024 09:26:24 -0700 Message-ID: Subject: Re: [PATCH v3 0/5] page allocation tag compression To: Andrew Morton Cc: kent.overstreet@linux.dev, corbet@lwn.net, arnd@arndb.de, mcgrof@kernel.org, rppt@kernel.org, paulmck@kernel.org, thuth@redhat.com, tglx@linutronix.de, bp@alien8.de, xiongwei.song@windriver.com, ardb@kernel.org, david@redhat.com, vbabka@suse.cz, mhocko@suse.com, hannes@cmpxchg.org, roman.gushchin@linux.dev, dave@stgolabs.net, willy@infradead.org, liam.howlett@oracle.com, pasha.tatashin@soleen.com, souravpanda@google.com, keescook@chromium.org, dennis@kernel.org, jhubbard@nvidia.com, yuzhao@google.com, vvvvvv@google.com, rostedt@goodmis.org, iamjoonsoo.kim@lge.com, rientjes@google.com, minchan@google.com, kaleshsingh@google.com, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org, linux-mm@kvack.org, linux-modules@vger.kernel.org, kernel-team@android.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Rspam-User: X-Rspamd-Queue-Id: 37731C0006 X-Rspamd-Server: rspam01 X-Stat-Signature: arwod94uuqa3o9uyry1t4wj1t59y1xd7 X-HE-Tag: 1729009593-13049 X-HE-Meta: U2FsdGVkX18Ro2FMqvP+gtYsH7vQ5A8ypEB1PbiQHwk84GFiFxsHRyxHMYe4qZ2hst8Kr78so+x9/MSWmlQZoz89dpAnM4hpueNcyvuq9hAvUpvJphGnRDm/8BENf1HRu1/o1vOa4djm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w+LyvfsOD5YFvID7dkBhlqQ/r2y/m/Y0bWfH1Scxb8am9ATXczrtkU26PUEThq63G6dgJ3lmwNBunPo= X-Bogosity: Ham, tests=bogofilter, spamicity=0.000001, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: On Mon, Oct 14, 2024 at 6:48=E2=80=AFPM Suren Baghdasaryan wrote: > > On Mon, Oct 14, 2024 at 4:32=E2=80=AFPM Andrew Morton wrote: > > > > On Mon, 14 Oct 2024 13:36:41 -0700 Suren Baghdasaryan wrote: > > > > > Patch #2 copies module tags into virtually contiguous memory which > > > serves two purposes: > > > - Lets us deal with the situation when module is unloaded while there > > > are still live allocations from that module. Since we are using a cop= y > > > version of the tags we can safely unload the module. Space and gaps i= n > > > this contiguous memory are managed using a maple tree. > > > > Does this make "lib: alloc_tag_module_unload must wait for pending > > kfree_rcu calls" unneeded? > > With this change we can unload a module even when tags from that > module are still in use. However "lib: alloc_tag_module_unload must > wait for pending kfree_rcu calls" would still be useful because it > will allow us to release the memory occupied by module's tags and let > other modules use that memory. > > > If so, that patch was cc:stable (justifyably), so what to do about tha= t? > > Now that I posted this patchset I'll work on backporting "lib: > alloc_tag_module_unload must wait for pending kfree_rcu calls" and its > prerequisites to 6.10 and 6.11. I'll try to get backports out > tomorrow. I prepared 6.10 and 6.11 backports for https://lore.kernel.org/all/20241007205236.11847-1-fw@strlen.de but will wait for it to get merged into Linus' tree before posting them to stable. Thanks, Suren. > I don't think we need to backport this patchset to pre-6.12 kernels > since this is an improvement and not a bug fix. But if it's needed I > can backport it as well. > Thanks, > Suren.