linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Jeremy Kerr <jk@ozlabs.org>
To: linuxppc-dev@ozlabs.org
Subject: Re: [Patch] powerpc/cell: make ptcal more reliable
Date: Tue, 5 May 2009 10:57:18 +1000	[thread overview]
Message-ID: <200905051057.19562.jk@ozlabs.org> (raw)
In-Reply-To: <87iqkgd5qm.fsf@de.ibm.com>

Hi Gerhard,

> This is for QS21. The following patch allocates pages only from
> the specified node, moves the ptcal area into the middle of the
> allocated page to avoid potential prefetch problems and prints
> the address of the ptcal area to facilitate diagnostics.

You're seeing prefetches that cross a page boundary?

> -	area->pages = alloc_pages_node(area->nid, GFP_KERNEL, area->order);
> +	area->pages = alloc_pages_node(area->nid, GFP_KERNEL |
> GFP_THISNODE, area->order);

Best to keep this under 80 cols.

>
> -	if (!area->pages)
> +	if (!area->pages) {
> +		printk(KERN_INFO "%s: no page on node %d\n",
> +			__FUNCTION__, area->nid);
>  		goto out_free_area;
> +	}

That could probably be a KERN_ERR, as we don't have ptcal enabled on 
that node. Also, I believe __func__ is preferred over __FUNCTION__.

> -	addr = __pa(page_address(area->pages));
> +	/*
> +	 * We move the ptcal area to the middle of the allocated
> +	 * page, in order to avoid prefetches in memcpy and similar
> +	 * functions stepping on it.
> +	 */
> +	addr = __pa(page_address(area->pages)) + (PAGE_SIZE >> 1);

Minor nitpick, but I think (PAGE_SIZE / 2) better illustrates that 
you're putting the addr in the middle of the page. But either should be 
fine.

> +	printk(KERN_INFO "%s: enabling PTCAL on node %d address=0x%016lx
> PAGE_SIZE>>1=0x%016lx \n",
> +			__FUNCTION__, area->nid, addr, PAGE_SIZE>>1);

80 cols again. Can we do this as a pr_debug?

Cheers,

Jeremy

  reply	other threads:[~2009-05-05  1:24 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-05-04 19:32 [Patch] powerpc/cell: make ptcal more reliable stenzel
2009-05-05  0:57 ` Jeremy Kerr [this message]
2009-05-05 10:47   ` Gerhard Stenzel

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=200905051057.19562.jk@ozlabs.org \
    --to=jk@ozlabs.org \
    --cc=linuxppc-dev@ozlabs.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).