All of lore.kernel.org
 help / color / mirror / Atom feed
From: David VomLehn <dvomlehn@cisco.com>
To: linux-mips@linux-mips.org
Subject: Re: Does HIGHMEM work on 32-bit MIPS ports?
Date: Wed, 05 Mar 2008 14:55:48 -0800	[thread overview]
Message-ID: <47CF24F4.4010508@cisco.com> (raw)

We've made significant progress in getting HIGHMEM to work on our 24K 
processor, but things do not completely work yet. Since I don't yet have 
confidence that we know everything that's going on, I"m not ready to 
submit a full-blown patch, but here's what we've done so far. Please 
send comments/suggestions...

The function __flush_dcache_page (in arch/mips/mm/cache.c) was simply 
returning if the struct page* argument it was given indicated we had a 
page in high memory, so the dcache was never being flushed. This is an 
obvious Bad Thing.

Our first modification was to expand the check for high memory. If the 
page had a temporary mapping, i.e. it was mapped through kmap_atomic(), 
we call flush_data_cache_page(). We then immediately return:

    if (PageHighMem(page)) {
        addr = (unsigned long)kmap_atomic_to_vaddr(page);
        if (addr != 0) {
            flush_data_cache_page(addr);
        }
        return;
    }

(kmap_atomic_to_vaddr() returns the virtual address if the page is 
mapped with kmap_atomic(), otherwise it returns NULL). This change by 
itself is enough to be able to boot with NFS most of the time. I think 
it is not sufficient for permanently mapped kernel pages (those mapped 
with kmap_high()). So, I made two other modifications.

Additional Modification #1: To me, it looks like the return should be 
moved to right after the call to flush_data_cache_page() so that we only 
return immediately for temporary kernel mappings.

The next section of code, which I think already works correctly with 
high memory, is:

    if (mapping && !mapping_mapped(mapping)) {
        SetPageDcacheDirty(page);
        return;
    }

We then have the following:

    addr = (unsigned long) page_address(page);
    flush_data_cache_page(addr);

Additional Modification #2: If the page is in high memory, it may not 
have a kernel mapping, in which case page_address() will return NULL. 
So, I've modified the code to only call flush_data_cache_page() if the 
page_address() doesn't return NULL.

With the two additional modifications above, thing are still not 
completely reliable. So, two questions:

   1. Does what we've done so far make sense?
   2. Since the behavior is still somewhat flaky, I'm still missing
      something. Any suggestions?

-- 
David VomLehn, dvomlehn@cisco.com
The opinions expressed herein are likely mine, but might not be my employer's...

             reply	other threads:[~2008-03-05 22:56 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-03-05 22:55 David VomLehn [this message]
2008-03-06 15:44 ` Does HIGHMEM work on 32-bit MIPS ports? Ralf Baechle
  -- strict thread matches above, loose matches on Subject: below --
2008-03-07  5:02 David VomLehn
2008-02-26 21:06 David VomLehn
2008-02-20 19:20 David VomLehn
2008-02-21 10:55 ` Maciej W. Rozycki
2008-02-20  4:09 David VomLehn
2008-02-20 16:18 ` Ralf Baechle

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=47CF24F4.4010508@cisco.com \
    --to=dvomlehn@cisco.com \
    --cc=linux-mips@linux-mips.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 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.