All of lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas Hellstrom <thellstrom@vmware.com>
To: Francisco Jerez <currojerez@riseup.net>
Cc: dri-devel <dri-devel@lists.sourceforge.net>
Subject: Re: [PATCH] drm/ttm: Avoid conflicting reserve_memtype during ttm_tt_set_page_caching.
Date: Tue, 26 Jan 2010 13:25:20 +0100	[thread overview]
Message-ID: <4B5EDF30.30801@vmware.com> (raw)
In-Reply-To: <87hbq93x4m.fsf@riseup.net>

Francisco Jerez wrote:
> Sorry for bringing this up again with nothing new to say, but it's still
> a problem (on nouveau it usually triggers a slow CPU-based eviction
> fallback). Thomas: Are you OK with this patch?
>
>   

Sorry, I've missed this patch. So is the problem that the core kernel 
complains if you try to move directly from wc to uc? In that case it 
looks OK to me:

Acked-by: Thomas Hellstrom <thellstrom@vmware.com>


>   
>> Fixes errors like:
>>     
>>> reserve_ram_pages_type failed 0x15b7a000-0x15b7b000, track 0x8, req 0x10
>>>       
>> when a BO is moved between WC and UC areas.
>>
>> Reported-by: Xavier Chantry <shiningxc@gmail.com>
>> Signed-off-by: Francisco Jerez <currojerez@riseup.net>
>> ---
>>  drivers/gpu/drm/ttm/ttm_tt.c |   23 ++++++++++++++++-------
>>  1 files changed, 16 insertions(+), 7 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/ttm/ttm_tt.c b/drivers/gpu/drm/ttm/ttm_tt.c
>> index 9c2b1cc..e2123af 100644
>> --- a/drivers/gpu/drm/ttm/ttm_tt.c
>> +++ b/drivers/gpu/drm/ttm/ttm_tt.c
>> @@ -198,17 +198,26 @@ EXPORT_SYMBOL(ttm_tt_populate);
>>  static inline int ttm_tt_set_page_caching(struct page *p,
>>  					  enum ttm_caching_state c_state)
>>  {
>> +	int ret = 0;
>> +
>>  	if (PageHighMem(p))
>>  		return 0;
>>  
>> -	switch (c_state) {
>> -	case tt_cached:
>> -		return set_pages_wb(p, 1);
>> -	case tt_wc:
>> -	    return set_memory_wc((unsigned long) page_address(p), 1);
>> -	default:
>> -		return set_pages_uc(p, 1);
>> +	if (get_page_memtype(p) != -1) {
>> +		/* p isn't in the default caching state, set it to
>> +		 * writeback first to free its current memtype. */
>> +
>> +		ret = set_pages_wb(p, 1);
>> +		if (ret)
>> +			return ret;
>>  	}
>> +
>> +	if (c_state == tt_wc)
>> +		ret = set_memory_wc((unsigned long) page_address(p), 1);
>> +	else if (c_state == tt_uncached)
>> +		ret = set_pages_uc(p, 1);
>> +
>> +	return ret;
>>  }
>>  #else /* CONFIG_X86 */
>>  static inline int ttm_tt_set_page_caching(struct page *p,
>> -- 
>> 1.6.4.4
>>     


------------------------------------------------------------------------------
The Planet: dedicated and managed hosting, cloud storage, colocation
Stay online with enterprise data centers and the best network in the business
Choose flexible plans and management services without long-term contracts
Personal 24x7 support from experience hosting pros just a phone call away.
http://p.sf.net/sfu/theplanet-com
--

      reply	other threads:[~2010-01-26 12:25 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-01-12  0:10 reserve_ram_pages_type failed Xavier
     [not found] ` <91752841001111610q78af5515g73725e3c4aa56e67-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2010-01-12  8:33   ` Maarten Maathuis
2010-01-12 17:49   ` [PATCH] drm/ttm: Avoid conflicting reserve_memtype during ttm_tt_set_page_caching Francisco Jerez
2010-01-26 11:48     ` Francisco Jerez
2010-01-26 12:25       ` Thomas Hellstrom [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=4B5EDF30.30801@vmware.com \
    --to=thellstrom@vmware.com \
    --cc=currojerez@riseup.net \
    --cc=dri-devel@lists.sourceforge.net \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.