From: David Hildenbrand <david@redhat.com>
To: Leesoo Ahn <lsahn@ooseel.net>, Mike Rapoport <rppt@kernel.org>
Cc: Leesoo Ahn <lsahn@wewakecorp.com>,
Andrew Morton <akpm@linux-foundation.org>,
linux-mm@kvack.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] mm/sparse: return right away if sparsemap_buf is null
Date: Wed, 7 Aug 2024 14:03:52 +0200 [thread overview]
Message-ID: <96439797-355e-493f-b652-1d933c4739b8@redhat.com> (raw)
In-Reply-To: <CANTT7qg7JRZR0DpaUg_YFVTrbBDE9hrb_6bv4XDQ_3QXcgY_vw@mail.gmail.com>
On 07.08.24 05:21, Leesoo Ahn wrote:
> 2024년 7월 28일 (일) 오후 9:43, Mike Rapoport <rppt@kernel.org>님이 작성:
>>
>> On Fri, Jul 26, 2024 at 04:10:23PM +0900, Leesoo Ahn wrote:
>>> sparse_buffer_fini(..) takes the following actions even though the value of
>>> sparsemap_buf is NULL,
>>> 1. calculate size of sparsemap buffer (which is meaningless).
>>> 2. set sparsemap_buf variable to NULL (although it is already NULL).
>>>
>>> These steps are unnecessary if the variable, sparsemap_buf is NULL.
>>>
>>> Refactor the function to return right away if the variable is NULL.
>>> Hence, it doesn't need to take further actions.
>>
>> sparse_buffer_fini() is called a few times on init so saving a jump (if at
>> all) does not worth the churn.
>
> Fair enough.
>
> Any related to refactoring codebase will be unlikely to be taken into upstream??
Any reasonable cleanups or reasonable optimizations are welcome.
Micro-optimizations that effectively add code/LOC, not so much :)
--
Cheers,
David / dhildenb
prev parent reply other threads:[~2024-08-07 12:03 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-07-26 7:10 Leesoo Ahn
2024-07-28 12:43 ` Mike Rapoport
2024-07-29 6:57 ` Anshuman Khandual
2024-08-07 3:21 ` Leesoo Ahn
2024-08-07 12:03 ` David Hildenbrand [this message]
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=96439797-355e-493f-b652-1d933c4739b8@redhat.com \
--to=david@redhat.com \
--cc=akpm@linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=lsahn@ooseel.net \
--cc=lsahn@wewakecorp.com \
--cc=rppt@kernel.org \
/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
all inboxes | Powered by JetHome®