public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Badari Pulavarty <pbadari@us.ibm.com>
To: Dave Hansen <haveblue@us.ibm.com>
Cc: Andy Whitcroft <andyw@uk.ibm.com>,
	lkml <linux-kernel@vger.kernel.org>,
	dwg@au1.ibm.com
Subject: Re: 2.6.15-rc4 panic in __nr_to_section() with CONFIG_SPARSEMEM
Date: Thu, 08 Dec 2005 08:07:35 -0800	[thread overview]
Message-ID: <1134058055.21841.70.camel@localhost.localdomain> (raw)
In-Reply-To: <1134002888.30387.82.camel@localhost>

On Wed, 2005-12-07 at 16:48 -0800, Dave Hansen wrote:
> On Wed, 2005-12-07 at 15:22 -0800, Badari Pulavarty wrote:
> > BTW, the problem seems to be while dealing with shared memory areas
> > that are backed by largepages.
> 
> I think this is likely not directly a sparsemem problem.  It probably
> just shows symptoms earlier.
> 
> See the attached patch.  It attempts to detect and handle hugetlb pages
> in the smaps code.  However, I think one of the root issues here is that
> bad_pmd() triggers for hugetlb pmds.  I audited a few places where it is
> called, and at least a couple of them can't have hugepages handed into
> them, like fork().
> 
> -- Dave
> 
> 
> 
> ---
> 
>  proc-dups-dave/fs/proc/task_mmu.c |   22 ++++++++++++++++++++++
>  1 files changed, 22 insertions(+)
> 
> diff -puN fs/proc/task_mmu.c~task_mmu_fix fs/proc/task_mmu.c
> --- proc-dups/fs/proc/task_mmu.c~task_mmu_fix	2005-12-07 16:34:38.000000000 -0800
> +++ proc-dups-dave/fs/proc/task_mmu.c	2005-12-07 16:34:47.000000000 -0800
> @@ -245,6 +245,28 @@ static inline void smaps_pmd_range(struc
>  	pmd = pmd_offset(pud, addr);
>  	do {
>  		next = pmd_addr_end(addr, end);
> +
> +		if (pmd_huge(*pmd)) {
> +			struct page *page;
> +
> +			page = follow_huge_pmd(vma->vm_mm, addr, pmd, 0);
> +			if (!page)
> +				continue;
> +
> +			mss->resident += HPAGE_SIZE;
> +			if (page_count(page) >= 2) {
> +				if (pte_dirty(*(pte_t *)pmd))
> +					mss->shared_dirty += HPAGE_SIZE;
> +				else
> +					mss->shared_clean += HPAGE_SIZE;
> +			} else {
> +				if (pte_dirty(*(pte_t *)pmd))
> +					mss->private_dirty += HPAGE_SIZE;
> +				else
> +					mss->private_clean += HPAGE_SIZE;
> +			}
> +			continue;
> +		}
>  		if (pmd_none_or_clear_bad(pmd))
>  			continue;
>  		smaps_pte_range(vma, pmd, addr, next, mss);


No. It doesn't help. It looks like ppc pmd_huge() always returns 0.
Don't know why ? :(

Thanks,
Badari


  reply	other threads:[~2005-12-08 16:07 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-12-07 22:37 2.6.15-rc4 panic in __nr_to_section() with CONFIG_SPARSEMEM Badari Pulavarty
2005-12-07 22:52 ` Dave Hansen
2005-12-07 23:05 ` Andy Whitcroft
2005-12-07 23:22   ` Badari Pulavarty
2005-12-07 23:34     ` Dave Hansen
2005-12-08  0:48     ` Dave Hansen
2005-12-08 16:07       ` Badari Pulavarty [this message]
2005-12-08 19:15         ` Dave Hansen
2005-12-08 19:33           ` Hugh Dickins
2005-12-08 19:47             ` Dave Hansen
2005-12-08 19:53               ` Badari Pulavarty
2005-12-08 23:48           ` David Gibson
2005-12-09  0:16             ` Dave Hansen
2005-12-12 16:19               ` Badari Pulavarty
2005-12-12 21:28                 ` Dave Hansen

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=1134058055.21841.70.camel@localhost.localdomain \
    --to=pbadari@us.ibm.com \
    --cc=andyw@uk.ibm.com \
    --cc=dwg@au1.ibm.com \
    --cc=haveblue@us.ibm.com \
    --cc=linux-kernel@vger.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