Linux-kernel mailing list archive 1999-21,: Re: [PATCH] cache large files in the page cache

# Re: [PATCH] cache large files in the page cache

Jakub Jelinek (jj@sunsite.ms.mff.cuni.cz)
Wed, 26 May 1999 09:44:07 +0200

- Messages sorted by: [ date ][ thread ][ subject ][ author ]
- Next message: Andrea Arcangeli: "Re: ia32 ip checksum optimizations"
- Previous message: Ildar Mulyukov: "Problem: Kernel panic"

> Details:
>
> This patch replaces vm_offset with vm_index, with the relationship:
> vm_offset == (vm_index << PAGE_SHIFT). Except vm_index can hold larger
> offsets.

I have minor suggestion to the patch. Instead of using vm_index <<
PAGE_SHIFT and page->key << PAGE_CACHE_SHIFT shifts either choose different
constant names for this shifting (VM_INDEX_SHIFT and PAGE_KEY_SHIFT) or hide
these shifts by some pretty macros (you'll need two for each for both
directions in that case - if you go the macro way, maybe it would be a good
idea to make vm_index and key type some structure with a single member like
mm_segment_t for more strict typechecking). This would have the advantage of
avoiding shifting on 64bit archs, where it really is not necessary as no
filesystem will support 16000EB filesizes in the near future. I know shifts
are not expensive, on the other side count how many there will be and IMHO
it should be considered. It could make the code more readable at the same
time. VM_INDEX_SHIFT would be defined to 0 on alpha,sparc64
(merced,mips64,ppc64) and PAGE_SHIFT on other platforms. The same with
PAGE_KEY_SHIFT.

Cheers,
Jakub
___________________________________________________________________
Jakub Jelinek | jj@sunsite.mff.cuni.cz | http://sunsite.mff.cuni.cz
Administrator of SunSITE Czech Republic, MFF, Charles University
___________________________________________________________________
UltraLinux | http://ultra.linux.cz/ | http://ultra.penguin.cz/
Linux version 2.3.3 on a sparc64 machine (1343.49 BogoMips)
___________________________________________________________________

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/

- Next message: Andrea Arcangeli: "Re: ia32 ip checksum optimizations"
- Previous message: Ildar Mulyukov: "Problem: Kernel panic"