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]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id D4E1BCA6018 for ; Fri, 9 Oct 2026 11:29:18 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id E94C06B00A1; Fri, 9 Oct 2026 07:29:17 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id E45106B00A2; Fri, 9 Oct 2026 07:29:17 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id D5AEC6B00A3; Fri, 9 Oct 2026 07:29:17 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id AC86B6B00A1 for ; Fri, 9 Oct 2026 07:29:17 -0400 (EDT) Received: from smtpin07.hostedemail.com (lb01a-stub [10.200.18.249]) by unirelay01.hostedemail.com (Postfix) with ESMTP id 4A27D1C3736 for ; Fri, 9 Oct 2026 11:29:17 +0000 (UTC) X-FDA: 85302866754.07.5384ECF Received: from mta0.migadu.com (out-238.mta0.migadu.com [91.218.175.238]) by imf18.hostedemail.com (Postfix) with ESMTP id 1ABBB1C0006 for ; Fri, 9 Oct 2026 11:29:14 +0000 (UTC) Authentication-Results: imf18.hostedemail.com; dkim=pass header.d=linux.dev header.s=key1 header.b=oIAtzHD+; spf=pass (imf18.hostedemail.com: domain of hao.ge@linux.dev designates 91.218.175.238 as permitted sender) smtp.mailfrom=hao.ge@linux.dev; dmarc=pass (policy=none) header.from=linux.dev ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1791545355; 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=3lZQEAXM5d3JKKOLgek0em0QcuT2R31gaDHkaPER77k=; b=1NKw1YivxcK37XdKMSGcy8ec/xYQXKlj0k+jDOGTqgSJWRgWDeMz+Nqz0C4Gw+tguU2CNx dJdwlH6UuU3yN6a50ExYsWvZUcmeflQCzfQHo7w8hV99QNmCZovaZNVCzDrW3aiC42hKk1 DFCNgO2P3gZEdz/TRaRsm94qfa7eB+0= ARC-Authentication-Results: i=1; imf18.hostedemail.com; dkim=pass header.d=linux.dev header.s=key1 header.b=oIAtzHD+; spf=pass (imf18.hostedemail.com: domain of hao.ge@linux.dev designates 91.218.175.238 as permitted sender) smtp.mailfrom=hao.ge@linux.dev; dmarc=pass (policy=none) header.from=linux.dev ARC-Seal: i=1; a=rsa-sha256; d=hostedemail.com; s=arc-20220608; cv=none; t=1791545355; b=YTsrjw7HKq3sRLd7DyYsqrkwfi7WCsP6p5XHxNsbsjonN3Gc4StsOCVLpQzpzxFypRuCqT MUgpRLcXr1xjGkibbYufvyeZfSgfKcPUpMKGrPMphYb8E6uSp1iJGX9Q6OW0xtz/bBCc7T R0Pub71hdWDogkjSkG45+udqxMkRIcs= X-Envelope-To: linux-mm@kvack.org DKIM-Signature: a=rsa-sha256; bh=9x2VgaCQqq1qe9Sd3mI+ji7pCRHxHu0WOqvf+sHVC10=; c=simple/simple; d=linux.dev; h=from:to:subject:date:message-id:mime-version:content-type; s=key1; t=1791545353; v=1; x=1792150153; b=oIAtzHD+uyGDbZl2cSPP5H6EUsoC6yqhf1U++gKNvFIMGOyKEhJClrLnVuvCY793VrA007Y7 5eas06fDn2HdlS0g6su4jxWsW63kqxYajDnrDpvqWf1nPUNL8H5v6V5Vf43MWNRIQPhU9aYyojF tf6q36X2dohhfQoMuRkM9n0E= X-Envelope-To: linux-mm@kvack.org Received: by smtp.migadu.com with ESMTPS id 13a9e522eed7582a; Fri, 09 Oct 2026 11:29:13 +0000 X-Mizu-Trace-ID: 13a9e522eed7582a X-Migadu-Flow: FLOW_OUT Message-ID: <839d13ef-8ca3-4e58-9bd0-84137f2d6866@linux.dev> Date: Fri, 9 Oct 2026 19:30:21 +0800 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v11 0/7] alloc_tag and module codetag section fixes To: Suren Baghdasaryan Cc: Andrew Morton , Kent Overstreet , Luis Chamberlain , Petr Pavlu , Daniel Gomez , Sami Tolvanen , Aaron Tomlin , Alexander Potapenko , Marco Elver , Dmitry Vyukov , Vlastimil Babka , Michal Hocko , Brendan Jackman , Johannes Weiner , Zi Yan , Uladzislau Rezki , linux-mm@kvack.org, linux-kernel@vger.kernel.org, linux-modules@vger.kernel.org, kasan-dev@googlegroups.com References: <20260929082014.160587-1-hao.ge@linux.dev> <20260929134401.a1a385ff4369661f879b5d2f@linux-foundation.org> Content-Language: en-US From: Hao Ge In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Server: rspam06 X-Rspamd-Queue-Id: 1ABBB1C0006 X-Rspam-User: X-Stat-Signature: pt61uxqss61ai3dnyzbbegpfa9s3hwiq X-HE-Tag: 1791545354-126993 X-HE-Meta: U2FsdGVkX1+OT2xBY8dghsC3pVheId6zlmZhrUc7PG9i9d4NMVB24vucypq9G4oNos+atbRzjPXtikUuShY5PQmNW+Rkt9K1KZHhcfvVc9lKTT2UtDeS/hGX5pxmallq4VajjMd9LECgHwP8nSP8s38NzizuKKoyl/QrX1Nu6y0w8RteQ7uL+gyIP9jdsja7Jjxw4+puPsEIuJXKwuTwKecGpH08t+w5UMgUl6cp91bbfrvF9b4feuCU22oJqpz1UN8luAJksF8MxYD6mMYipEWFPj9Q12+ypl29ZHouU7ftExH/TVP2Pp0xroEupHtgYBbwBwT7YM0V0F1E+Nt3gwzgrBMrXsD3VujAFlwNaZ2n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xw6TqSnTOw5fwCRXv9495fnFV1H52iLpTKnHz/VCQHfCOw= Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: Hi Suren On 2026/10/5 02:37, Suren Baghdasaryan wrote: > On Wed, Sep 30, 2026 at 5:25 AM Hao Ge wrote: >> >> Hi Suren and Andrew >> >> >> On 2026/9/30 10:39, Suren Baghdasaryan wrote: >>> On Tue, Sep 29, 2026 at 8:44 PM Andrew Morton wrote: >>>> >>>> On Tue, 29 Sep 2026 16:20:07 +0800 Hao Ge wrote: >>>> >>>>> With profiling toggled off, the overflow check in >>>>> reserve_module_tags() did not run, a module could load with more >>>>> tags than the page flags can address, and re-enabling profiling >>>>> then silently corrupted /proc/allocinfo. On overflow the fix shuts >>>>> profiling down, releases the reservation and returns -EAGAIN, and >>>>> the codetag section lands as regular module data in the same load, >>>>> so the module loads without profiling. >>>>> >>>>> Review of the earlier series by Sashiko turned up more problems. >>>>> >>>>> One is a race. layout_sections() and move_module() both asked >>>>> codetag_needs_module_section() where a codetag section goes, and >>>>> mem_profiling_support can change between the two calls, for instance >>>>> when another module load overflows the tag index and shuts profiling >>>>> down. move_module() then copied the codetag section to offset 0 of >>>>> its regular destination and clobbered the first section placed in >>>>> that region. >>>>> >>>>> v7 reworks where codetag sections are allocated, on a prototype by >>>>> Petr Pavlu [1]. The allocation runs before layout_sections() and the >>>>> placement is decided in one step, so nothing re-asks the question >>>>> and the race is gone. The retry is gone too, on -EAGAIN the section >>>>> is laid out as regular module data right in the same load. >>>> >>>> Thanks. >>>> >>>> Seven patches, all cc:stable. Why is a backport proposed? >>>> Documentation/process/stable-kernel-rules.rst gives guidelines - does >>>> this series meet them? Does Suren have thoughts? >> >> Thanks, I've just gone through this carefully. >> >>> >>> I think vmalloc fix in patch#2 should be posted separately and clearly >>> quialifies for backporting as if fixes issues Hao found at [1]. >> >> Agreed. Patch #2 was added to this patch series because vm_module_tags_populate >> suffers from the same issue. If we want to be more conservative, I'd prefer to keep >> vm_module_tags_populate as it was in V10: >> https://lore.kernel.org/all/20260915070001.113559-3-hao.ge@linux.dev/ > > I disagree with this approach. That means we are introducing an extra > code inside vm_module_tags_populate() only to clean it up later. > Instead please post Patch #2 separately. That posting should have your > current patch that changes vmap_pages_xxx() to clean up on failure, > followed by patch(es) which remove unnecessary cleanup that some > functions currently perform by themselves. This patchset should > definitely be tagged for stable. You are right. Sorry for the confusion - my earlier deviation came from not fully understanding the rules for getting patches into the stable trees. > Once that patchset is accepted, the rest of your current patchset > fixing alloc_tags can be posted with correct assumption that > vmap_pages_range() cleans up its partial mapping when it fails. > > I know this sequence will take longer to upstream but I think it's the > right way to go. Make sense. Thanks for your continued support. Best Regards Hao > >> >> Then we can submit a fix for __GFP_NOFAIL retry loop in __vmalloc_area_node() as a hotfix together >> with our new patch #2. While at it, we can also check if there are any unnecessary calls to >> vunmap_range family functions that can be cleaned up now that patch #2 is applied. >> >> >>> >>> The rest are also bug fixes but their size is concerning. I'll review >>> them first before advising on which ones should be backported. Some >>> fixes address issues that happen very rarely and if a fix is too >>> complex it might make sense to leave it be or fix it some other way >>> with less churn. Please give me a couple of days to review them. With >>> the upcoming LPC I'm trying to multiplex between several projects. >> >> Thanks, sorry for all the hassle on you folks. >> >> Thanks >> Best Regards >> Hao >> >>> >>> [1] https://lore.kernel.org/all/b8005c24-ecac-45c4-840a-fd282f9693b5@linux.dev/ >>> >>>> >>>> Also, Sashiko has been busy again: >>>> https://sashiko.dev/#/patchset/20260929082014.160587-1-hao.ge@linux.dev