linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: minchan.kim@gmail.com (Minchan Kim)
To: linux-arm-kernel@lists.infradead.org
Subject: About SECTION_SIZE_BITS for Sparsemem
Date: Mon, 12 Jul 2010 19:35:17 +0900	[thread overview]
Message-ID: <AANLkTinkujX3VbL0sXjjghovr8eX9Os0huw3OTBut2UP@mail.gmail.com> (raw)
In-Reply-To: <001b01cb21aa$ef0e4d80$cd2ae880$%kim@samsung.com>

Hi, Mel and Kame.

On Mon, Jul 12, 2010 at 7:13 PM, Kukjin Kim <kgene.kim@samsung.com> wrote:
> Minchan Kim wrote:
>>
>> Hello.
>>
> Hello :-)
>
>> On Mon, Jul 12, 2010 at 5:32 PM, Kukjin Kim <kgene.kim@samsung.com> wrote:
>> > Russell,
>> >
>> > Hi,
>> >
>> > Kukjin Kim wrote:
>> >> Russell wrote:
>> >> > So, memory starts at 0x20000000 and finishes at 0x25000000. ?That's
>> > fine.
>> >> > That doesn't mean the section size is 16MB.
>> >> >
>> >> > As I've already said, the section size has _nothing_ what so ever to
> do
>> >> > with the size of memory, or the granularity of the size of memory.
> ?By
>> >> > way of illustration, it is perfectly legal to have a section size of
>> >> > 256MB but only have 1MB in a section and this is perfectly legal. ?So
>> >> > sections do not have to be completely filled.
>> >> >
>> >> Actually, as you know, the hole's area of mem_map is freed from bootmem
> if
>> > a
>> >> section has a hole when initializing sparse memory.
>> >>
>> >> I identified that a section doesn't need to be a contiguous area of
>> > physical
>> >> memory when reading your comment with the fact that the mem_map of a
>> > section
>> >> can be smaller than the size of a section.
>> >>
>> >> I found, however, the kernel panics when modifying min_free_kbytes file
> in
>> >> the proc filesystem if a section has a hole.
>> >>
>> >> While processing the change of min_free_kbytes in the kernel, page
>> >> descriptors in a hole of an online section is accessed.
>> >
>> > As I said, following error happens.
>> > It would be helpful to me if any opinions or comments.
>> >
>>
>> Could you test below patch?
>> Also, you should select ARCH_HAS_HOLES_MEMORYMODEL in your config.
>>
> Yes, I did it, and no kernel panic happens :-)
>
> Same test...
> [root at Samsung ~]# cat /proc/sys/vm/min_free_kbytes
> 2736
> [root at Samsung ~]# echo "2730" > /proc/sys/vm/min_free_kbytes
> [root at Samsung ~]#
> [root at Samsung ~]# cat /proc/sys/vm/min_free_kbytes
> 2730
>
>
>> @@ -2824,8 +2825,13 @@ static void setup_zone_migrate_reserve(struct zone
>> *zone)
>> ? ? ? ? for (pfn = start_pfn; pfn < end_pfn; pfn += pageblock_nr_pages) {
>> ? ? ? ? ? ? ? ? if (!pfn_valid(pfn))
>> ? ? ? ? ? ? ? ? ? ? ? ? continue;
>> +
>> ? ? ? ? ? ? ? ? page = pfn_to_page(pfn);
>>
>> + ? ? ? ? ? ? ? ?/* Watch for unexpected holes punched in the memmap */
>> + ? ? ? ? ? ? ? ?if (!memmap_valid_within(pfn, page, zone))
>> + ? ? ? ? ? ? ? ? ? ? ? ?continue;
>> +
>> ? ? ? ? ? ? ? ? /* Watch out for overlapping nodes */
>> ? ? ? ? ? ? ? ? if (page_to_nid(page) != zone_to_nid(zone))
>> ? ? ? ? ? ? ? ? ? ? ? ? continue;
>>
>>
>>
>
> ...Could you please explain about this issue?

The setup_zone_migrate_reserve doesn't check memmap hole. I think
compaction would have the  same problem, too. I don't know there is a
problem in elsewhere.
Anyway, I think memmap_valid_within calling whenever walking whole pfn
range isn't a good solution. We already have pfn_valid. Could we check
this in there?
For example, mem_section have a valid pfn range and then valid section
can test it in pfn_valid.

What do you think about it?

P.S)
I know Mel is very busy to test to avoid writeback in direct reclaim.
I can wait on you. :)
Kukjin. Is this a urgent issue? If it isn't, please wait on our mm guys. :)

-- 
Kind regards,
Minchan Kim

  reply	other threads:[~2010-07-12 10:35 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-07-12  8:32 About SECTION_SIZE_BITS for Sparsemem Kukjin Kim
2010-07-12  9:35 ` Kyungmin Park
2010-07-12  9:58   ` Kukjin Kim
2010-07-12 10:08     ` Kyungmin Park
2010-07-12 10:13       ` Russell King - ARM Linux
2010-07-12  9:52 ` Minchan Kim
2010-07-12 10:13   ` Kukjin Kim
2010-07-12 10:35     ` Minchan Kim [this message]
2010-07-13  0:25       ` KAMEZAWA Hiroyuki
2010-07-13  1:53         ` KAMEZAWA Hiroyuki
2010-07-13 18:31           ` Russell King - ARM Linux
2010-07-13  2:05         ` Minchan Kim
2010-07-13  3:03           ` KAMEZAWA Hiroyuki
2010-07-13  9:28             ` Mel Gorman
2010-07-13  9:38               ` Russell King - ARM Linux
2010-07-13  9:26       ` Mel Gorman
2010-07-13  9:38         ` Russell King - ARM Linux
2010-07-13  9:50           ` Mel Gorman
2010-07-13 17:37             ` Russell King - ARM Linux
2010-07-13 20:32               ` Mel Gorman
2010-07-13 23:59                 ` Minchan Kim
2010-07-14  8:49                   ` Russell King - ARM Linux
2010-07-14 11:04                     ` Minchan Kim
2010-07-14 20:49                       ` Russell King - ARM Linux
2010-07-16  0:07                         ` Minchan Kim
2010-07-14  8:59                 ` Russell King - ARM Linux
2010-07-14 13:14                   ` Mel Gorman
2010-07-12 10:45   ` Russell King - ARM Linux
2010-07-12 12:28     ` Minchan Kim
2010-07-12 12:42       ` Russell King - ARM Linux

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=AANLkTinkujX3VbL0sXjjghovr8eX9Os0huw3OTBut2UP@mail.gmail.com \
    --to=minchan.kim@gmail.com \
    --cc=linux-arm-kernel@lists.infradead.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).