linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Zi Yan <ziy@nvidia.com>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Linux-MM <linux-mm@kvack.org>,
	Steven Rostedt <rostedt@goodmis.org>,
	David Hildenbrand <david@redhat.com>,
	Vlastimil Babka <vbabka@suse.cz>,
	Mel Gorman <mgorman@techsingularity.net>,
	Mike Rapoport <rppt@kernel.org>,
	Oscar Salvador <osalvador@suse.de>,
	Andrew Morton <akpm@linux-foundation.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 2/2] mm: wrap __find_buddy_pfn() with a necessary buddy page validation.
Date: Fri, 01 Apr 2022 12:37:11 -0400	[thread overview]
Message-ID: <31FDAB92-ACE2-4502-9970-77C21D6EBB5D@nvidia.com> (raw)
In-Reply-To: <CAHk-=wjToETfvzxkz_Y=QPt0JQRHF3VZ51xjhbPNAneHFvZofw@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 701 bytes --]

On 1 Apr 2022, at 12:31, Linus Torvalds wrote:

> On Fri, Apr 1, 2022 at 6:58 AM Zi Yan <zi.yan@sent.com> wrote:
>>
>> +extern bool find_buddy_page_pfn(struct page *page, unsigned int order,
>> +                               struct page **buddy, unsigned long *buddy_pfn);
>
> Wouldn't it make more sense to just return the 'struct page *buddy'
> here, instead of the 'bool'?
>
> So a NULL buddy means the obvious "no buddy found".
>
> I dislike those "pass return value by reference" in general, and the
> above has _two_ of them.
>
> We can get rid of at least one very obviously.

Sure. We can get rid of both and calculate buddy_pfn from buddy after
a successful call.


--
Best Regards,
Yan, Zi

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 854 bytes --]

  reply	other threads:[~2022-04-01 16:37 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-01 13:58 [PATCH 1/2] mm: page_alloc: simplify pageblock migratetype check in __free_one_page() Zi Yan
2022-04-01 13:58 ` [PATCH 2/2] mm: wrap __find_buddy_pfn() with a necessary buddy page validation Zi Yan
2022-04-01 16:31   ` Linus Torvalds
2022-04-01 16:37     ` Zi Yan [this message]
2022-04-01 14:12 ` [PATCH 1/2] mm: page_alloc: simplify pageblock migratetype check in __free_one_page() David Hildenbrand
2022-04-01 14:19   ` Zi Yan
2022-04-01 14:22     ` David Hildenbrand
2022-04-01 14:32       ` David Hildenbrand
2022-04-02  7:45         ` Kalle Valo
2022-04-02  7:52           ` Kalle Valo
2022-04-02 12:00             ` Zi Yan
2022-04-04  8:46               ` David Hildenbrand
2022-04-04  8:43             ` David Hildenbrand

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=31FDAB92-ACE2-4502-9970-77C21D6EBB5D@nvidia.com \
    --to=ziy@nvidia.com \
    --cc=akpm@linux-foundation.org \
    --cc=david@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mgorman@techsingularity.net \
    --cc=osalvador@suse.de \
    --cc=rostedt@goodmis.org \
    --cc=rppt@kernel.org \
    --cc=torvalds@linux-foundation.org \
    --cc=vbabka@suse.cz \
    /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