From: David Hildenbrand <david@redhat.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
"Rafael J. Wysocki" <rafael@kernel.org>,
Pavel Tatashin <pasha.tatashin@soleen.com>,
Michal Hocko <mhocko@suse.com>,
Dan Williams <dan.j.williams@intel.com>,
Oscar Salvador <osalvador@suse.de>
Subject: Re: [PATCH v1] drivers/base/memory.c: Don't store end_section_nr in memory blocks
Date: Thu, 1 Aug 2019 08:48:06 +0200 [thread overview]
Message-ID: <e9e3a428-0b06-dda3-3171-c76286cee37b@redhat.com> (raw)
In-Reply-To: <20190731135715.ddb4fccb5c4ee2f14f84a34a@linux-foundation.org>
On 31.07.19 22:57, Andrew Morton wrote:
> On Wed, 31 Jul 2019 14:22:13 +0200 David Hildenbrand <david@redhat.com> wrote:
>
>> Each memory block spans the same amount of sections/pages/bytes. The size
>> is determined before the first memory block is created. No need to store
>> what we can easily calculate - and the calculations even look simpler now.
>>
>> While at it, fix the variable naming in register_mem_sect_under_node() -
>> we no longer talk about a single section.
>>
>> ...
>>
>> --- a/include/linux/memory.h
>> +++ b/include/linux/memory.h
>> @@ -40,6 +39,8 @@ int arch_get_memory_phys_device(unsigned long start_pfn);
>> unsigned long memory_block_size_bytes(void);
>> int set_memory_block_size_order(unsigned int order);
>>
>> +#define PAGES_PER_MEMORY_BLOCK (memory_block_size_bytes() / PAGE_SIZE)
>
> Please let's not hide function calls inside macros which look like
> compile-time constants! Adding "()" to the macro would be a bit
> better. Making it a regular old inline C function would be better
> still. But I'd suggest just open-coding this at the macro's single
> callsite.
>
Sure, makes sense. Thanks!
--
Thanks,
David / dhildenb
prev parent reply other threads:[~2019-08-01 6:48 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-07-31 12:22 [PATCH v1] drivers/base/memory.c: Don't store end_section_nr in memory blocks David Hildenbrand
2019-07-31 12:43 ` Michal Hocko
2019-07-31 13:12 ` David Hildenbrand
2019-07-31 13:25 ` Michal Hocko
2019-07-31 13:42 ` David Hildenbrand
2019-07-31 14:04 ` David Hildenbrand
2019-07-31 14:15 ` Michal Hocko
2019-07-31 14:23 ` David Hildenbrand
2019-07-31 14:14 ` Michal Hocko
2019-07-31 14:21 ` David Hildenbrand
2019-07-31 14:37 ` Michal Hocko
2019-07-31 14:43 ` David Hildenbrand
2019-08-01 6:13 ` Michal Hocko
2019-08-01 7:00 ` David Hildenbrand
2019-08-01 8:27 ` Michal Hocko
2019-08-01 8:36 ` David Hildenbrand
2019-07-31 20:57 ` Andrew Morton
2019-08-01 6:48 ` 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=e9e3a428-0b06-dda3-3171-c76286cee37b@redhat.com \
--to=david@redhat.com \
--cc=akpm@linux-foundation.org \
--cc=dan.j.williams@intel.com \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mhocko@suse.com \
--cc=osalvador@suse.de \
--cc=pasha.tatashin@soleen.com \
--cc=rafael@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;
as well as URLs for NNTP newsgroup(s).