Re: problem with cache flush routine for G5?

From: Chris Friesen (cfriesen_at_nortelnetworks.com)
Date: 03/05/04

  • Next message: Mike Hearn: "Potential bug in fs/binfmt_elf.c?"
    Date:	Fri, 05 Mar 2004 12:21:36 -0500
    To: Benjamin Herrenschmidt <benh@kernel.crashing.org>
    
    

    Benjamin Herrenschmidt wrote:
    >>Assuming that I really did want to flush the whole cache, how would I go
    >>about doing that from userspace?
    >>
    >
    > I don't think you can do it reliably, but again, that do not make
    > sense, so please check with those folks what's exactly going on.

    I've gotten some more information on what's going on.

    We have a proprietary OS (originally written for custom hardware) that
    is running on a thin emulation layer on top of linux.

    This OS allows runtime patching of code. After changing the
    instruction(s), it then has to make sure that the icache doesn't contain
    stale instructions.

    The original code was written for ppc hardware that had the ability to
    flush the whole dcache and invalidate the whole icache, all at once, so
    that's what they used. The code doesn't track the address/size of what
    was changed. For our existing products, we are using the 74xx series,
    and they've got hardware cache flush/invalidate as well, so we just kept
    using that. For the 970 however, that hardware mechanisms seem to be
    absent, which started me on this whole path.

    After doing some digging in the 970fx specs, it seems that we may not
    need to explicitly force a store of the L1 dcache at all. According to
    the docs, the L1 dcache is unconditionally store-through. Thus, for a
    brute-force implementation we should be able to just invalidate the
    whole icache, do the appropriate sync/isync, and it should pick up the
    changed instructions from the L2 cache. Do you see any problems with
    this? Do I actually still need the store?

    Of course, the proper fix is to change the code in the OS running on the
    emulator to track the addresses that got changed and just do the minimal
    work required.

    Chris

    -- 
    Chris Friesen                    | MailStop: 043/33/F10
    Nortel Networks                  | work: (613) 765-0557
    3500 Carling Avenue              | fax:  (613) 765-2986
    Nepean, ON K2H 8E9 Canada        | email: cfriesen@nortelnetworks.com
    -
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at  http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at  http://www.tux.org/lkml/
    

  • Next message: Mike Hearn: "Potential bug in fs/binfmt_elf.c?"

    Relevant Pages

    • Re: Possible ways of dealing with OOM conditions.
      ... There is more to networking that skbs only, what about route cache, ... With power-of-two allocation SLAB wastes 500 bytes for each 1500 MTU ... Well, if you have such hardware its not rare at all, But yeah that ... adds to the fragmentation issues on the page-allocator level. ...
      (Linux-Kernel)
    • flush cache range proposal (was Re: ide errors in 7-rc1-mm1 and later)
      ... If bit 0 is set to one, the mandatory FLUSH CACHE and FLUSH CACHE EXT ... commands support the RANGE bit, and user-supplied LBA ... and sector count specifying the limits of the cache flush. ...
      (Linux-Kernel)
    • Re: [00/17] Large Blocksize Support V3
      ... allocations, and then creating all this complexity around that is not a ... Now why are high end hardware manufacturers building crippled ... For I/O we have the BIO which can point to multiple pages just fine. ... the page cache from the BIO and from the BIO to the page cache. ...
      (Linux-Kernel)
    • Re: 2.6, 3.0, and truly independent intepreters
      ... reduces the overhead of lock acquisition, while still allowing use of global ... And the overhead of doing that at the level of a cache ... You still need to minimize contention of course, ... then it'll be faster to have it in hardware. ...
      (comp.lang.python)
    • Re: range-based cache flushing (was Re: Linux 2.6.29)
      ... will flush the data for all of its partitions from the write cache.... ... SCSI'S SYNCHRONIZE CACHE command already accepts an ... How difficult would it be to pass the "lower-bound" LBA to SYNCHRONIZE ...
      (Linux-Kernel)