From: Vlastimil Babka <vbabka@suse.cz>
To: Chen Ridong <chenridong@huaweicloud.com>,
Roman Gushchin <roman.gushchin@linux.dev>,
akpm@linux-foundation.org, david@fromorbit.com
Cc: Muchun Song <muchun.song@linux.dev>,
Anshuman Khandual <anshuman.khandual@arm.com>,
"Kirill A. Shutemov" <kirill@shutemov.name>,
zhengqi.arch@bytedance.com, linux-mm@kvack.org,
linux-kernel@vger.kernel.org, wangweiyang2@huawei.com
Subject: Re: [PATCH v2] mm: shrinker: avoid memleak in alloc_shrinker_info
Date: Thu, 24 Oct 2024 11:08:38 +0200 [thread overview]
Message-ID: <1625e2e0-06ad-459c-b941-41fadea2008d@suse.cz> (raw)
In-Reply-To: <e919c9ba-1d93-4e68-9146-33d1e28103dc@huaweicloud.com>
On 10/24/24 03:26, Chen Ridong wrote:
>>>> For example, if we use his v1 proposal, we should do
>>>> the cleanups again for info. But for goto-based
>>>> version, we just add another label to do the
>>>> cleanups and go to the new label for failure case. goto-based fix is what I insisted on. I copied my previous suggested fix here to clarify my opinion.
>>>
>>> Again, info is a loop-iteration-local variable, v1 fix making it truly local
>>> is the way to go. If there are further cleanups added in the loop itself in
>>> the future, they could hopefully keep being local to the loop as well.
>>> Cleanup of info outside the loop iteration is breaking its real scope.
>>
>> +1 to that.
>>
>> I don't think it's such a big deal and both versions are ok, but I strongly
>> prefer the original version (without introduction of a new label).
>>
>> Please, feel free to use
>> Acked-by: Roman Gushchin <roman.gushchin@linux.dev>
>> with the original version.
>>
>> Thanks!
>
> I agree with Roman.
> Hello, Andrew and Dave, Do you have any opinions?
>
> The original version:
> https://lore.kernel.org/linux-kernel/4184c61f-80f7-4adc-8929-c29f959cb8df@huawei.com/
Hi,
Can you resend the v1 as v3, but also move the declaration of "struct
shrinker_info *info;" inside the for_each_node() block? Also you can add all
the acks collected for that version and mine too:
Acked-by: Vlastimil Babka <vbabka@suse.cz>
Thanks.
> Best regards,
> Ridong
>
>
next prev parent reply other threads:[~2024-10-24 9:08 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-14 3:23 Chen Ridong
2024-10-14 6:25 ` Muchun Song
2024-10-14 8:13 ` Anshuman Khandual
2024-10-14 8:43 ` Muchun Song
2024-10-14 9:04 ` chenridong
2024-10-14 9:20 ` Muchun Song
2024-10-14 9:38 ` chenridong
2024-10-16 12:13 ` Vlastimil Babka
2024-10-16 14:22 ` Muchun Song
2024-10-17 2:41 ` Qi Zheng
2024-10-14 11:29 ` Kirill A. Shutemov
2024-10-15 1:13 ` chenridong
2024-10-15 6:55 ` Anshuman Khandual
2024-10-16 1:25 ` chenridong
2024-10-16 2:21 ` Muchun Song
2024-10-16 10:16 ` Kirill A. Shutemov
2024-10-16 13:37 ` Muchun Song
2024-10-16 11:43 ` Vlastimil Babka
2024-10-16 14:08 ` Muchun Song
2024-10-16 17:02 ` Vlastimil Babka
2024-10-16 17:31 ` Roman Gushchin
2024-10-24 1:26 ` Chen Ridong
2024-10-24 9:08 ` Vlastimil Babka [this message]
2024-10-25 1:22 ` Chen Ridong
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1625e2e0-06ad-459c-b941-41fadea2008d@suse.cz \
--to=vbabka@suse.cz \
--cc=akpm@linux-foundation.org \
--cc=anshuman.khandual@arm.com \
--cc=chenridong@huaweicloud.com \
--cc=david@fromorbit.com \
--cc=kirill@shutemov.name \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=muchun.song@linux.dev \
--cc=roman.gushchin@linux.dev \
--cc=wangweiyang2@huawei.com \
--cc=zhengqi.arch@bytedance.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox