* 2.6.0-test9-mm4
@ 2003-11-19 6:51 Andrew Morton
2003-11-19 9:02 ` 2.6.0-test9-mm4 William Lee Irwin III
2003-11-19 11:13 ` 2.6.0-test9-mm4 Gene Heskett
0 siblings, 2 replies; 8+ messages in thread
From: Andrew Morton @ 2003-11-19 6:51 UTC (permalink / raw)
To: linux-kernel, linux-mm
ftp://ftp.kernel.org/pub/linux/kernel/people/akpm/patches/2.6/2.6.0-test9/2.6.0-test9-mm4/
. Several fixes against patches which are only in -mm at present.
. Minor fixes which we'll queue for post-2.6.0.
. The interactivity problems which the ACPI PM timer patch showed up
should be fixed here - please sing out if not.
Changes since 2.6.0-test9-mm3:
linus.patch
Latest Linus tree
-tulip-hash-fix.patch
Merged
+msi-various-fixes.patch
ia32 Message Signalled Interrupt fixlets
-compat_ioctl-cleanup.patch
other changes broke this.
+compat-statfs-fixes.patch
compat layer fixes
+ia32-sched_clock-fix.patch
Fix sched_clock() for when the TSC is not the time source.
+timer_pm-verbose-timesource-fix.patch
+acpi-pm_timer-init-cpu_khz.patch
+timer_pm-fix-fix-fix.patch
ia32 PM timer fixes
+forcedeth-update-2.patch
Update for the nForce ethernet driver
-drm-agp-module-dependency-fix.patch
This generated nasty warnings and I wasn't able to get it to autoload the
AGP module when loading the DRM module anyway.
+xattr-arith-fix.patch
64-bit fixes for the ext2 and ext3 extended attribute code.
+radeon-line-length-fix.patch
Radeon fbdev driver fix
+resource-bounds-fix.patch
Fix Memory/IO resource management boundary condition bug.
+proc-interrupts-use-seq-file.patch
Convert /proc/interrupts to seq_file (breaks lots of archs)
+ide-tape-update.patch
Make ide-tape work.
+mpparse-printk-fix.patch
Don't try to print nulls into the boot logs.
+intel-440gx-ids-fix.patch
The 440gx PCI IDs were wrong.
+centrino-1ghz-support.patch
Add cpufreq support for the 1GHz Centrinos.
+nonmodular-binfmt_elf.patch
Disallow CONFIG_BINFMT_ELF=m - it doesn't work and isn't useful.
+pnp-fix-1.patch
+pnp-fix-2.patch
+pnp-fix-3.patch
PNP updates.
+document-elevator-equals.patch
Documentation update
+cpio-offset-fix.patch
Fix generation of the initramfs cpio image.
+watchdog-retval-fix.patch
Return the right thing from the watchdog write() functions.
+document-lib-parser.patch
Documentation update
+format_cpumask.patch
Fix format_cpumask()
+init-remove-CLONE_FILES.patch
Don't start init with CLONE_FILES - it causes fd inheritance in undesirable
ways.
+alpha-stack-dump.patch
Additional debug for unaligned accesses on Alpha
+usb-msgsize-fix.patch
Support 1024k packets on USB2.0
+pagefault-accounting-fix.patch
Fix the major-vs-minor pagefault accounting.
+proc_kill_inodes-oops-fix.patch
Might fix oops in proc-kill_inodes()
+proc_bus_pci_lseek-remove-lock_kernel.patch
lock_kernel() removal.
+lockmeter-sparc64-fix.patch
Fix sparc64 build for the lockmeter patch.
+4g4g-vm86-fix.patch
4G/4G fix.
All 231 patches:
linus.patch
mm.patch
add -mmN to EXTRAVERSION
kgdb-ga.patch
kgdb stub for ia32 (George Anzinger's one)
kgdbL warning fix
kgdb-buff-too-big.patch
kgdb buffer overflow fix
kgdb-warning-fix.patch
kgdbL warning fix
kgdb-build-fix.patch
kgdb-spinlock-fix.patch
kgdb-fix-debug-info.patch
kgdb: CONFIG_DEBUG_INFO fix
kgdb-cpumask_t.patch
kgdb-x86_64-fixes.patch
x86_64 fixes
kgdb-over-ethernet.patch
kgdb-over-ethernet patch
kgdb-over-ethernet-fixes.patch
kgdb-over-ethernet fixlets
kgdb-CONFIG_NET_POLL_CONTROLLER.patch
kgdb: replace CONFIG_KGDB with CONFIG_NET_RX_POLL in net drivers
kgdb-handle-stopped-NICs.patch
kgdb: handle netif_stopped NICs
eepro100-poll-controller.patch
tlan-poll_controller.patch
tulip-poll_controller.patch
tg3-poll_controller.patch
kgdb: tg3 poll_controller
8139too-poll_controller.patch
8139too poll controller
kgdb-eth-smp-fix.patch
kgdb-over-ethernet: fix SMP
kgdb-eth-reattach.patch
kgdb-skb_reserve-fix.patch
kgdb-over-ethernet: skb_reserve() fix
must-fix.patch
should-fix.patch
must-fix-update-01.patch
must fix lists update
RD1-cdrom_ioctl-B6.patch
RD2-ioctl-B6.patch
RD2-ioctl-B6-fix.patch
RD2-ioctl-B6 fixes
RD3-cdrom_open-B6.patch
RD4-open-B6.patch
RD5-cdrom_release-B6.patch
RD6-release-B6.patch
RD7-presto_journal_close-B6.patch
RD8-f_mapping-B6.patch
RD9-f_mapping2-B6.patch
RD10-i_sem-B6.patch
RD11-f_mapping3-B6.patch
RD12-generic_osync_inode-B6.patch
RD13-bd_acquire-B6.patch
RD14-generic_write_checks-B6.patch
RD15-I_BDEV-B6.patch
cramfs-use-pagecache.patch
cramfs: use pagecache better
invalidate_inodes-speedup.patch
invalidate_inodes speedup
invalidate_inodes-speedup-fixes-2.patch
more invalidate_inodes speedup fixes
serio-01-renaming.patch
serio: rename serio_[un]register_slave_port to __serio_[un]register_port
serio-02-race-fix.patch
serio: possible race between port removal and kseriod
serio-03-blacklist.patch
Add black list to handler<->device matching
serio-04-synaptics-cleanup.patch
Synaptics: code cleanup
serio-05-reconnect-facility.patch
serio: reconnect facility
serio-06-synaptics-use-reconnect.patch
Synaptics: use serio_reconnect
acpi_off-fix.patch
fix acpi=off
cfq-4.patch
CFQ io scheduler
CFQ fixes
config_spinline.patch
uninline spinlocks for profiling accuracy.
ppc64-bar-0-fix.patch
Allow PCI BARs that start at 0
ppc64-reloc_hide.patch
sym-do-160.patch
make the SYM driver do 160 MB/sec
input-use-after-free-checks.patch
input layer debug checks
aic7xxx-parallel-build-fix.patch
fix parallel builds for aic7xxx
ramdisk-cleanup.patch
intel8x0-cleanup.patch
intel8x0 cleanups
pdflush-diag.patch
kobject-oops-fixes.patch
fix oopses is kobject parent is removed before child
futex-uninlinings.patch
futex uninlining
zap_page_range-debug.patch
zap_page_range() debug
call_usermodehelper-retval-fix-3.patch
Make call_usermodehelper report exit status
asus-L5-fix.patch
Asus L5 framebuffer fix
jffs-use-daemonize.patch
tulip-NAPI-support.patch
tulip NAPI support
tulip-napi-disable.patch
tulip NAPI: disable poll in close
get_user_pages-handle-VM_IO.patch
ia32-MSI-support.patch
Updated ia32 MSI Patches
ia32-MSI-support-x86_64-fixes.patch
msi-various-fixes.patch
MSI Update Based on 2.6.0-test9-mm3
ia32-efi-support.patch
EFI support for ia32
efi warning fix
fix EFI for ppc64, ia64
efi: warning fixes
ia32 EFI: Add CONFIG_EFI
efi: Update Kconfig help
efi update patch (ia64)
support-zillions-of-scsi-disks.patch
support many SCSI disks
SGI-IOC4-IDE-chipset-support.patch
Add support for SGI's IOC4 chipset
sparc32-sched_clock.patch
pcibios_test_irq-fix.patch
Fix pcibios test IRQ handler return
fixmap-in-proc-pid-maps.patch
report user-readable fixmap area in /proc/PID/maps
i82365-sysfs-ordering-fix.patch
Fix init_i82365 sysfs ordering oops
pci_set_power_state-might-sleep.patch
ia64-ia32-missing-compat-syscalls.patch
From: Arun Sharma <arun.sharma@intel.com>
Subject: Missing compat syscalls in ia64
compat-layer-fixes.patch
Minor bug fixes to the compat layer
compat-ioctl-for-i2c.patch
compat_ioctl for i2c
compat-statfs-fixes.patch
COMPAT statfs64 bug fixes
fix-sqrt.patch
sqrt() fixes
scale-min_free_kbytes.patch
scale the initial value of min_free_kbytes
cdrom-allocation-try-harder.patch
Use __GFP_REPEAT for cdrom buffer
sym-2.1.18f.patch
CONFIG_STANDALONE-default-to-n.patch
Make CONFIG_STANDALONE default to N
extra-buffer-diags.patch
nosysfs.patch
constant_test_bit-doesnt-like-zwanes-gcc.patch
gcc bug workaround for constant_test_bit()
slab-leak-detector.patch
slab leak detector
early-serial-registration-fix.patch
serial console registration bugfix
3c527-smp-update.patch
SMP support on 3c527 net driver
3c527-race-fix.patch
ext3-latency-fix.patch
ext3 scheduling latency fix
videobuf_waiton-race-fix.patch
firmware-kernel_thread-on-demand.patch
Remove workqueue usage from request_firmware_async()
loop-autoloading-fix.patch
Fix loop module auto loading
loop-module-alias.patch
loop needs MODULE_ALIAS_BLOCK
loop-remove-blkdev-special-case.patch
loop-highmem.patch
remove useless highmem bounce from loop/cryptoloop
loop-highmem-fixes.patch
loop-bio-handling-fix.patch
loop: BIO handling fix
cmpci-set_fs-fix.patch
cmpci.c: remove pointless set_fs()
dentry-bloat-fix-2.patch
Fix dcache and icache bloat with deep directories
nls-config-fixes.patch
NSL config fixes
proc_pid_lookup-vs-exit-race-fix.patch
Fix proc_pid_lookup vs exit race
gcc-Os-if-embedded.patch
Add `gcc -Os' config option
aic7xxx-sleep-in-spinlock-fix.patch
vm86-sysenter-fix.patch
Fix sysenter disabling in vm86 mode
gettimeofday-resolution-fix.patch
gettimeofday resolution fix
refill_counter-overflow-fix.patch
vmscan: reset refill_counter after refilling the inactive list
ia32-sched_clock-fix.patch
sched_clock() fix
verbose-timesource.patch
be verbose about the time source
acpi-pm-timer.patch
ACPI PM Timer
acpi-pm-timer-fixes.patch
ACPI PM-Timer fixes
timer_pm-verbose-timesource-fix.patch
Subject: [PATCH] linux-2.6.0-test9-mm3_verbose-timesource-acpi-pm_A0
acpi-pm_timer-init-cpu_khz.patch
ACPI PM timer: initialise cpu_khz
timer_pm-fix-fix-fix.patch
acpi PM timer fix
as-regression-fix.patch
Fix IO scheduler regression
as-request-poisoning.patch
AS: request poisoning
as-request-poisoning-fix.patch
AS: request poisining fix
as-fix-all-known-bugs.patch
AS fixes
as-new-process-estimation.patch
AS: new process estimation
as-cooperative-thinktime.patch
AS: thinktime improvement
scale-nr_requests.patch
scale nr_requests with TCQ depth
truncate_inode_pages-check.patch
local_bh_enable-warning-fix.patch
cdc-acm-softirq-rx.patch
cdc-acm: move rx processing to softirq
forcedeth.patch
forcedeth: nForce ethernet driver
forcedeth-update-2.patch
forcedeth update
reiserfs-pinned-buffer-fix.patch
reiserfs pinned buffer fix
proc-pid-maps-output-fix.patch
Restore /proc/pid/maps formatting
atomic_dec-debug.patch
atomic_dec debug
sis900-pm-support.patch
Add PM support to sis900 network driver
8139too-locking-fix.patch
8139too locking fix
ia32-wp-test-cleanup.patch
ia32 WP test cleanup
hugetlb-needs-pse.patch
ia32: hugetlb needs pse
powermate-payload-size-fix.patch
Griffin Powermate fix
more-than-256-cpus.patch
Fix for more than 256 CPUs
ZONE_SHIFT-from-NODES_SHIFT.patch
Use NODES_SHIFT to calculate ZONE_SHIFT
ext2_new_inode-fixes.patch
Fix bugs in ext2_new_inode()
ext2_new_inode-fixes-tweaks.patch
ext2_new_inode: more tweaking
remove-ext2_reverve_inode.patch
memmove-speedup.patch
optimize ia32 memmove
percpu-counter-linkage-fix.patch
fix percpu_counter_mod linkage problem
ide-scsi-warnings.patch
ide-scsi: warn when used for cdroms
pipe-readv-writev.patch
Fix writev atomicity on pipe/fifo
ext3_new_inode-scan-fix.patch
ext3_new_inode fixlet
lockless-semop.patch
lockless semop
percpu_counter-use-alloc_percpu.patch
use alloc_percpu in percpu_counters
i450nx-scanning-fix.patch
i450nx PCI scanning fix
serio-pm-fix.patch
psmouse pm resume fix
find_busiest_queue-commentary.patch
find_busiest_queue() commentary fix
ext2-block-allocator-fixes.patch
ext2 block allocator fixes
SOUND_CMPCI-config-typo-fix.patch
fix SOUND_CMPCI Configure help entry
atkbd-24-compatibility.patch
Fixes for keyboard 2.4 compatibility
init_h-needs-compiler_h.patch
init.h needs to include compiler.h
init_h-needs-compiler_h-fix.patch
compile fix for older gcc's
cpu_sibling_map-fix.patch
cpu_sibling_map fix
context-switch-accounting-fix.patch
Fix context switch accounting
access-vfs_permission-fix.patch
Subject: Re: [PATCH] fix access() / vfs_permission() bug
eicon-linkage-fix.patch
eicon/ and hardware/eicon/ drivers using the same symbols
kobject-docco-additions.patch
Improve documentation for kobjects
xattr-arith-fix.patch
fs/ext[23]/xattr.c pointer arithmetic fix
radeon-line-length-fix.patch
radeonfb fix
resource-bounds-fix.patch
resource.c bounds checking fix
promise-sata-id.patch
add Promise 20376 PCI ID
proc-interrupts-use-seq-file.patch
seq_file version of /proc/interrupts
ide-tape-update.patch
ide-tape update
mpparse-printk-fix.patch
mpparse printk fix
intel-440gx-ids-fix.patch
centrino-1ghz-support.patch
support centrino 1GHz
nonmodular-binfmt_elf.patch
disallow modular BINFMT_ELF
pnp-fix-1.patch
PnP Fixes #1
pnp-fix-2.patch
PnP Fixes #2
pnp-fix-3.patch
PnP Fixes #3
document-elevator-equals.patch
document elevator= parameter
cpio-offset-fix.patch
missing padding in cpio_mkfile in usr/gen_init_cpio.c
watchdog-retval-fix.patch
watchdog write() return value fixes
document-lib-parser.patch
Add lib/parser.c kernel-doc
format_cpumask.patch
format_cpumask()
init-remove-CLONE_FILES.patch
Remove CLONE_FILES from init kernel thread creation
alpha-stack-dump.patch
usb-msgsize-fix.patch
HiSpd Isoc 1024KB submits: -EMSGSIZE
pagefault-accounting-fix.patch
pagefault accounting fix
proc_kill_inodes-oops-fix.patch
proc_bus_pci_lseek-remove-lock_kernel.patch
remove lock_kernel() from proc_bus_pci_lseek()
list_del-debug.patch
list_del debug check
print-build-options-on-oops.patch
show_task-free-stack-fix.patch
show_task() fix and cleanup
oops-dump-preceding-code.patch
i386 oops output: dump preceding code
lockmeter.patch
lockmeter-sparc64-fix.patch
printk-oops-mangle-fix.patch
disentangle printk's whilst oopsing on SMP
4g-2.6.0-test2-mm2-A5.patch
4G/4G split patch
4G/4G: remove debug code
4g4g: pmd fix
4g/4g: fixes from Bill
4g4g: fpu emulation fix
4g/4g usercopy atomicity fix
4G/4G: remove debug code
4g4g: pmd fix
4g/4g: fixes from Bill
4g4g: fpu emulation fix
4g/4g usercopy atomicity fix
4G/4G preempt on vstack
4G/4G: even number of kmap types
4g4g: fix __get_user in slab
4g4g: Remove extra .data.idt section definition
4g/4g linker error (overlapping sections)
4G/4G: remove debug code
4g4g: pmd fix
4g/4g: fixes from Bill
4g4g: fpu emulation fix
4g4g: show_registers() fix
4g/4g usercopy atomicity fix
4g4g: debug flags fix
4g4g: Fix wrong asm-offsets entry
cyclone time fixmap fix
4G/4G preempt on vstack
4G/4G: even number of kmap types
4g4g: fix __get_user in slab
4g4g: Remove extra .data.idt section definition
4g/4g linker error (overlapping sections)
4G/4G: remove debug code
4g4g: pmd fix
4g/4g: fixes from Bill
4g4g: fpu emulation fix
4g4g: show_registers() fix
4g/4g usercopy atomicity fix
4g4g: debug flags fix
4g4g: Fix wrong asm-offsets entry
cyclone time fixmap fix
use direct_copy_{to,from}_user for kernel access in mm/usercopy.c
4G/4G might_sleep warning fix
4g/4g pagetable accounting fix
4g4g-athlon-prefetch-handling-fix.patch
4g4g-wp-test-fix.patch
Fix 4G/4G and WP test lockup
4g4g-KERNEL_DS-usercopy-fix.patch
4G/4G KERNEL_DS usercopy again
4g4g-vm86-fix.patch
Fix 4G/4G X11/vm86 oops
ppc-fixes.patch
make mm4 compile on ppc
aic7xxx_old-oops-fix.patch
O_DIRECT-race-fixes-rollup.patch
DIO fixes forward port and AIO-DIO fix
O_DIRECT race fixes comments
O_DRIECT race fixes fix fix fix
DIO locking rework
O_DIRECT XFS fix
dio-aio-fixes.patch
direct-io AIO fixes
dio-aio-fixes-fixes.patch
dio-aio fix fix
readahead-multiple-fixes.patch
readahead: multipole performance fixes
readahead-simplification.patch
readahead simplification
aio-sysctl-parms.patch
aio sysctl parms
aio-01-retry.patch
AIO: Core retry infrastructure
Fix aio process hang on EINVAL
AIO: flush workqueues before destroying ioctx'es
AIO: hold the context lock across unuse_mm
task task_lock in use_mm()
4g4g-aio-hang-fix.patch
Fix AIO and 4G-4G hang
aio-retry-elevated-refcount.patch
aio: extra ref count during retry
aio-splice-runlist.patch
Splice AIO runlist for fairer handling of multiple io contexts
aio-02-lockpage_wq.patch
AIO: Async page wait
aio-03-fs_read.patch
AIO: Filesystem aio read
aio-04-buffer_wq.patch
AIO: Async buffer wait
lock_buffer_wq fix
aio-05-fs_write.patch
AIO: Filesystem aio write
aio-06-bread_wq.patch
AIO: Async block read
aio-07-ext2getblk_wq.patch
AIO: Async get block for ext2
O_SYNC-speedup-2.patch
speed up O_SYNC writes
O_SYNC-speedup-2-f_mapping-fixes.patch
aio-09-o_sync.patch
aio O_SYNC
AIO: fix a BUG
Unify o_sync changes for aio and regular writes
aio-O_SYNC-fix bits got lost
aio: writev nr_segs fix
More AIO O_SYNC related fixes
aio-09-o_sync-f_mapping-fixes.patch
gang_lookup_next.patch
Change the page gang lookup API
aio-gang_lookup-fix.patch
AIO gang lookup fixes
aio-O_SYNC-short-write-fix.patch
Fix for O_SYNC short writes
aio-12-readahead.patch
AIO: readahead fixes
aio O_DIRECT no readahead
Unified page range readahead for aio and regular reads
aio-12-readahead-f_mapping-fix.patch
aio-readahead-speedup.patch
Readahead issues and AIO read speedup
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"aart@kvack.org"> aart@kvack.org </a>
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: 2.6.0-test9-mm4
2003-11-19 6:51 2.6.0-test9-mm4 Andrew Morton
@ 2003-11-19 9:02 ` William Lee Irwin III
2003-11-19 9:19 ` 2.6.0-test9-mm4 Andrew Morton
2003-11-19 11:13 ` 2.6.0-test9-mm4 Gene Heskett
1 sibling, 1 reply; 8+ messages in thread
From: William Lee Irwin III @ 2003-11-19 9:02 UTC (permalink / raw)
To: Andrew Morton; +Cc: linux-kernel, linux-mm
On Tue, Nov 18, 2003 at 10:51:20PM -0800, Andrew Morton wrote:
> ftp://ftp.kernel.org/pub/linux/kernel/people/akpm/patches/2.6/2.6.0-test9/2.6.0-test9-mm4/
> . Several fixes against patches which are only in -mm at present.
> . Minor fixes which we'll queue for post-2.6.0.
> . The interactivity problems which the ACPI PM timer patch showed up
> should be fixed here - please sing out if not.
I'm not sure if this is within the scope of current efforts, but I
gave it a shot just to see how bad untangling it from highpmd and
O(1) buffered_rmqueue() was. It turns out it wasn't that hard.
The codebase (so to speak) has been in regular use since June, though
the port to -mm only lightly tested (basically testbooted on a laptop).
There is some minor core impact.
--
This patch utilizes the tlb.h hooks to perform highpte-compatible pte
cacheing. The a priori benefits are cache conservation, and the motive
(of course) redressing an apparent regression in functionality and/or
performance vs. 2.4.
vs. 2.6.0-test9-mm4
-- wli
diff -prauN mm4-2.6.0-test9-1/arch/i386/mm/init.c mm4-2.6.0-test9-2/arch/i386/mm/init.c
--- mm4-2.6.0-test9-1/arch/i386/mm/init.c 2003-11-19 00:07:03.000000000 -0800
+++ mm4-2.6.0-test9-2/arch/i386/mm/init.c 2003-11-19 00:09:43.000000000 -0800
@@ -465,7 +465,7 @@ void __init mem_init(void)
/* this will put all low memory onto the freelists */
totalram_pages += __free_all_bootmem();
-
+ tlb_init();
reservedpages = 0;
for (tmp = 0; tmp < max_low_pfn; tmp++)
/*
diff -prauN mm4-2.6.0-test9-1/arch/i386/mm/pgtable.c mm4-2.6.0-test9-2/arch/i386/mm/pgtable.c
--- mm4-2.6.0-test9-1/arch/i386/mm/pgtable.c 2003-11-19 00:07:03.000000000 -0800
+++ mm4-2.6.0-test9-2/arch/i386/mm/pgtable.c 2003-11-19 00:22:54.000000000 -0800
@@ -139,18 +139,70 @@ pte_t *pte_alloc_one_kernel(struct mm_st
return pte;
}
-struct page *pte_alloc_one(struct mm_struct *mm, unsigned long address)
+void tlb_init(void)
{
- struct page *pte;
+ int cpu;
+ for (cpu = 0; cpu < NR_CPUS; ++cpu) {
+ int zone;
+ struct mmu_gather *tlb = &per_cpu(mmu_gathers, cpu);
+ for (zone = 0; zone < MAX_ZONE_ID; ++zone) {
+ INIT_LIST_HEAD(&tlb->active_list[zone]);
+ INIT_LIST_HEAD(&tlb->ready_list[zone]);
+ }
+ }
+}
-#ifdef CONFIG_HIGHPTE
- pte = alloc_pages(GFP_KERNEL|__GFP_HIGHMEM|__GFP_REPEAT, 0);
-#else
- pte = alloc_pages(GFP_KERNEL|__GFP_REPEAT, 0);
-#endif
- if (pte)
- clear_highpage(pte);
- return pte;
+static inline struct page *pte_alloc_fresh(int gfp_mask)
+{
+ struct page *page = alloc_page(gfp_mask);
+ if (page) {
+ clear_highpage(page);
+ if (TestSetPagePTE(page))
+ BUG();
+ }
+ return page;
+}
+
+static inline int zone_high(struct zone *zone)
+{
+ if (!zone)
+ return 1;
+ else
+ return zone - zone->zone_pgdat->node_zones >= ZONE_HIGHMEM;
+}
+
+static inline struct page *pte_alloc_ready(int gfp_flags)
+{
+ struct mmu_gather *tlb = &per_cpu(mmu_gathers, get_cpu());
+ unsigned long flags;
+ struct page *page = NULL;
+
+ smp_local_irq_save(flags);
+ if (tlb->nr_pte_ready) {
+ int z;
+ for (z = MAX_ZONE_ID - 1; z >= 0; --z) {
+ struct zone *zone = zone_table[z];
+ if (!(gfp_flags & __GFP_HIGHMEM) && zone_high(zone))
+ continue;
+ if (!list_empty(&tlb->ready_list[z]))
+ break;
+ }
+ page = list_entry(tlb->ready_list[z].next, struct page, list);
+ if (TestSetPagePTE(page))
+ BUG();
+ list_del(&page->list);
+ tlb->ready_count[z]--;
+ tlb->nr_pte_ready--;
+ }
+ smp_local_irq_restore(flags);
+ put_cpu();
+ return page;
+}
+
+struct page *pte_alloc_one(struct mm_struct *mm, unsigned long address)
+{
+ struct page *page = pte_alloc_ready(GFP_PTE);
+ return page ? page : pte_alloc_fresh(GFP_PTE);
}
void pmd_ctor(void *pmd, kmem_cache_t *cache, unsigned long flags)
@@ -320,3 +372,64 @@ out_free:
kmem_cache_free(pgd_cache, pgd);
}
+static void shrink_cpu_pagetable_cache(void *__gfp_mask)
+{
+ int cpu, zone, high, gfp_mask = (int)gfp_mask;
+ unsigned long flags;
+ struct mmu_gather *tlb;
+
+ high = !!(gfp_mask & __GFP_HIGHMEM);
+ cpu = get_cpu();
+ tlb = &per_cpu(mmu_gathers, cpu);
+ smp_local_irq_save(flags);
+
+ if (tlb->nr_pte_active)
+ tlb_flush(tlb);
+
+ /* Can't flush nonpte from interrupt context */
+
+ if (tlb->nr_pte_active) {
+ for (zone = 0; zone < MAX_ZONE_ID; ++zone) {
+ if (!high && zone_high(zone_table[zone]))
+ continue;
+ if (!tlb->active_count[zone])
+ continue;
+
+ list_splice_init(&tlb->active_list[zone], &tlb->ready_list[zone]);
+ tlb->ready_count[zone] += tlb->active_count[zone];
+ tlb->active_count[zone] = 0;
+ }
+ tlb->nr_pte_ready += tlb->nr_pte_active;
+ tlb->nr_pte_active = 0;
+ }
+
+ for (zone = 0; zone < MAX_ZONE_ID; ++zone) {
+ if (list_empty(&tlb->ready_list[zone]))
+ continue;
+ if (!high && zone_high(zone_table[zone]))
+ continue;
+
+ free_pages_bulk(zone_table[zone],
+ tlb->ready_count[zone],
+ &tlb->ready_list[zone],
+ 0);
+ tlb->nr_pte_ready -= tlb->ready_count[zone];
+ tlb->ready_count[zone] = 0;
+ }
+
+ smp_local_irq_restore(flags);
+ put_cpu();
+}
+
+void shrink_pagetable_cache(int gfp_mask)
+{
+ BUG_ON(irqs_disabled());
+
+ preempt_disable();
+
+ /* disables interrupts appropriately internally */
+ shrink_cpu_pagetable_cache((void *)gfp_mask);
+
+ smp_call_function(shrink_cpu_pagetable_cache, (void *)gfp_mask, 1, 1);
+ preempt_enable();
+}
diff -prauN mm4-2.6.0-test9-1/include/asm-i386/pgalloc.h mm4-2.6.0-test9-2/include/asm-i386/pgalloc.h
--- mm4-2.6.0-test9-1/include/asm-i386/pgalloc.h 2003-10-25 11:42:51.000000000 -0700
+++ mm4-2.6.0-test9-2/include/asm-i386/pgalloc.h 2003-11-19 00:26:00.000000000 -0800
@@ -31,14 +31,6 @@ static inline void pte_free_kernel(pte_t
free_page((unsigned long)pte);
}
-static inline void pte_free(struct page *pte)
-{
- __free_page(pte);
-}
-
-
-#define __pte_free_tlb(tlb,pte) tlb_remove_page((tlb),(pte))
-
/*
* allocating and freeing a pmd is trivial: the 1-entry pmd is
* inside the pgd, so has no extra memory associated with it.
@@ -47,9 +39,26 @@ static inline void pte_free(struct page
#define pmd_alloc_one(mm, addr) ({ BUG(); ((pmd_t *)2); })
#define pmd_free(x) do { } while (0)
-#define __pmd_free_tlb(tlb,x) do { } while (0)
#define pgd_populate(mm, pmd, pte) BUG()
#define check_pgt_cache() do { } while (0)
+#include <asm/tlb.h>
+
+static inline void pte_free(struct page *page)
+{
+ struct mmu_gather *tlb = &per_cpu(mmu_gathers, get_cpu());
+ tlb_remove_page(tlb, page);
+ put_cpu();
+}
+
+static inline void pte_free_tlb(struct mmu_gather *tlb, struct page *page)
+{
+ tlb_remove_page(tlb, page);
+}
+
+static inline void pmd_free_tlb(struct mmu_gather *tlb, pmd_t *pmd)
+{
+}
+
#endif /* _I386_PGALLOC_H */
diff -prauN mm4-2.6.0-test9-1/include/asm-i386/pgtable.h mm4-2.6.0-test9-2/include/asm-i386/pgtable.h
--- mm4-2.6.0-test9-1/include/asm-i386/pgtable.h 2003-11-19 00:07:12.000000000 -0800
+++ mm4-2.6.0-test9-2/include/asm-i386/pgtable.h 2003-11-19 00:09:43.000000000 -0800
@@ -44,6 +44,9 @@ void pgtable_cache_init(void);
void paging_init(void);
void setup_identity_mappings(pgd_t *pgd_base, unsigned long start, unsigned long end);
+#define HAVE_ARCH_PAGETABLE_CACHE
+void shrink_pagetable_cache(int gfp_mask);
+
#endif /* !__ASSEMBLY__ */
/*
diff -prauN mm4-2.6.0-test9-1/include/asm-i386/system.h mm4-2.6.0-test9-2/include/asm-i386/system.h
--- mm4-2.6.0-test9-1/include/asm-i386/system.h 2003-10-25 11:42:45.000000000 -0700
+++ mm4-2.6.0-test9-2/include/asm-i386/system.h 2003-11-19 00:09:43.000000000 -0800
@@ -461,6 +461,18 @@ struct alt_instr {
/* For spinlocks etc */
#define local_irq_save(x) __asm__ __volatile__("pushfl ; popl %0 ; cli":"=g" (x): /* no input */ :"memory")
+#ifdef CONFIG_SMP
+#define smp_local_irq_save(x) local_irq_save(x)
+#define smp_local_irq_restore(x) local_irq_restore(x)
+#define smp_local_irq_disable() local_irq_disable()
+#define smp_local_irq_enable() local_irq_enable()
+#else
+#define smp_local_irq_save(x) do { (void)(x); } while (0)
+#define smp_local_irq_restore(x) do { (void)(x); } while (0)
+#define smp_local_irq_disable() do { } while (0)
+#define smp_local_irq_enable() do { } while (0)
+#endif /* CONFIG_SMP */
+
/*
* disable hlt during certain critical i/o operations
*/
diff -prauN mm4-2.6.0-test9-1/include/asm-i386/tlb.h mm4-2.6.0-test9-2/include/asm-i386/tlb.h
--- mm4-2.6.0-test9-1/include/asm-i386/tlb.h 2003-10-25 11:43:17.000000000 -0700
+++ mm4-2.6.0-test9-2/include/asm-i386/tlb.h 2003-11-19 00:23:35.000000000 -0800
@@ -1,10 +1,52 @@
#ifndef _I386_TLB_H
#define _I386_TLB_H
+/*
+ * include/asm-i386/tlb.h
+ * (C) June 2003 William Irwin, IBM
+ * Routines for pagetable cacheing and release.
+ */
+
+#include <linux/config.h>
+#include <linux/mm.h>
+#include <linux/swap.h>
+#include <linux/gfp.h>
+#include <linux/list.h>
+#include <linux/percpu.h>
+#include <asm/tlbflush.h>
+
+#ifdef CONFIG_HIGHPTE
+#define GFP_PTE (GFP_KERNEL|__GFP_REPEAT|__GFP_HIGHMEM)
+#else
+#define GFP_PTE (GFP_KERNEL|__GFP_REPEAT)
+#endif
+
+#define PG_PTE PG_arch_1
+#define NR_PTE 128
+#define FREE_PTE_NR NR_PTE
+#define NR_NONPTE 512
+#define MAX_ZONE_ID (MAX_NUMNODES * MAX_NR_ZONES)
+
+#define PagePTE(page) test_bit(PG_PTE, &(page)->flags)
+#define SetPagePTE(page) set_bit(PG_PTE, &(page)->flags)
+#define ClearPagePTE(page) clear_bit(PG_PTE, &(page)->flags)
+#define TestSetPagePTE(page) test_and_set_bit(PG_PTE, &(page)->flags)
+#define TestClearPagePTE(page) test_and_clear_bit(PG_PTE, &(page)->flags)
+#define PageZoneID(page) ((page)->flags >> ZONE_SHIFT)
/*
- * x86 doesn't need any special per-pte or
- * per-vma handling..
+ * vmscan.c does smp_call_function() to shoot down cached pagetables under
+ * memory pressure.
*/
+struct mmu_gather {
+ struct mm_struct *mm;
+ int nr_pte_active, nr_pte_ready, nr_nonpte, need_flush, fullmm, freed;
+ struct list_head active_list[MAX_ZONE_ID], ready_list[MAX_ZONE_ID];
+ int active_count[MAX_ZONE_ID], ready_count[MAX_ZONE_ID];
+ struct page *nonpte[NR_NONPTE];
+};
+
+DECLARE_PER_CPU(struct mmu_gather, mmu_gathers);
+
#define tlb_start_vma(tlb, vma) do { } while (0)
#define tlb_end_vma(tlb, vma) do { } while (0)
#define __tlb_remove_tlb_entry(tlb, ptep, address) do { } while (0)
@@ -15,6 +57,119 @@
*/
#define tlb_flush(tlb) flush_tlb_mm((tlb)->mm)
-#include <asm-generic/tlb.h>
+void tlb_init(void);
-#endif
+static inline
+struct mmu_gather *tlb_gather_mmu(struct mm_struct *mm, unsigned int flush)
+{
+ struct mmu_gather *tlb = &per_cpu(mmu_gathers, get_cpu());
+ tlb->mm = mm;
+ tlb->fullmm = flush;
+ tlb->freed = 0;
+ put_cpu();
+ return tlb;
+}
+
+static inline
+void tlb_remove_tlb_entry(struct mmu_gather *tlb, pte_t *pte, unsigned long addr)
+{
+ tlb->need_flush = 1;
+}
+
+static inline
+void tlb_flush_ready(struct mmu_gather *tlb)
+{
+ int zone;
+
+ for (zone = 0; tlb->nr_pte_ready >= NR_PTE && zone < MAX_ZONE_ID; ++zone) {
+ if (!tlb->ready_count[zone])
+ continue;
+
+ free_pages_bulk(zone_table[zone],
+ tlb->ready_count[zone],
+ &tlb->ready_list[zone],
+ 0);
+ tlb->nr_pte_ready -= tlb->ready_count[zone];
+ tlb->ready_count[zone] = 0;
+ }
+}
+
+static inline
+void tlb_flush_mmu(struct mmu_gather *tlb, unsigned long start, unsigned long end)
+{
+ int zone;
+ unsigned long flags;
+
+ if (!tlb->need_flush && tlb->nr_nonpte < NR_NONPTE)
+ return;
+
+ tlb->need_flush = 0;
+ tlb_flush(tlb);
+
+ smp_local_irq_save(flags);
+
+ if (tlb->nr_nonpte) {
+ free_pages_and_swap_cache(tlb->nonpte, tlb->nr_nonpte);
+ tlb->nr_nonpte = 0;
+ }
+
+ for (zone = 0; zone < MAX_ZONE_ID; ++zone) {
+ if (!tlb->active_count[zone])
+ continue;
+
+ list_splice_init(&tlb->active_list[zone], &tlb->ready_list[zone]);
+ tlb->ready_count[zone] += tlb->active_count[zone];
+ tlb->active_count[zone] = 0;
+ }
+ tlb->nr_pte_ready += tlb->nr_pte_active;
+ tlb->nr_pte_active = 0;
+ if (tlb->nr_pte_ready >= NR_PTE)
+ tlb_flush_ready(tlb);
+
+ smp_local_irq_restore(flags);
+}
+
+static inline
+void tlb_finish_mmu(struct mmu_gather *tlb, unsigned long start, unsigned long end)
+{
+ if (tlb->mm->rss >= tlb->freed)
+ tlb->mm->rss -= tlb->freed;
+ else
+ tlb->mm->rss = 0;
+ tlb_flush_mmu(tlb, start, end);
+}
+
+static inline
+void tlb_remove_nonpte_page(struct mmu_gather *tlb, struct page *page)
+{
+ tlb->nonpte[tlb->nr_nonpte] = page;
+ tlb->nr_nonpte++;
+ if (tlb->nr_nonpte >= NR_NONPTE)
+ tlb_flush_mmu(tlb, 0, 0);
+}
+
+static inline
+void tlb_remove_pte_page(struct mmu_gather *tlb, struct page *page)
+{
+ int zone = PageZoneID(page);
+ ClearPagePTE(page);
+ tlb->nr_pte_active++;
+ tlb->active_count[zone]++;
+ list_add(&page->list, &tlb->active_list[zone]);
+}
+
+static inline
+void tlb_remove_page(struct mmu_gather *tlb, struct page *page)
+{
+ unsigned long flags;
+
+ smp_local_irq_save(flags);
+ tlb->need_flush = 1;
+ if (PagePTE(page))
+ tlb_remove_pte_page(tlb, page);
+ else
+ tlb_remove_nonpte_page(tlb, page);
+ smp_local_irq_restore(flags);
+}
+
+#endif /* _I386_TLB_H */
diff -prauN mm4-2.6.0-test9-1/include/linux/gfp.h mm4-2.6.0-test9-2/include/linux/gfp.h
--- mm4-2.6.0-test9-1/include/linux/gfp.h 2003-10-25 11:43:12.000000000 -0700
+++ mm4-2.6.0-test9-2/include/linux/gfp.h 2003-11-19 00:14:24.000000000 -0800
@@ -79,6 +79,7 @@ static inline struct page * alloc_pages_
extern unsigned long FASTCALL(__get_free_pages(unsigned int gfp_mask, unsigned int order));
extern unsigned long FASTCALL(get_zeroed_page(unsigned int gfp_mask));
+int free_pages_bulk(struct zone *zone, int count, struct list_head *list, unsigned int order);
#define __get_free_page(gfp_mask) \
__get_free_pages((gfp_mask),0)
diff -prauN mm4-2.6.0-test9-1/mm/page_alloc.c mm4-2.6.0-test9-2/mm/page_alloc.c
--- mm4-2.6.0-test9-1/mm/page_alloc.c 2003-11-19 00:07:15.000000000 -0800
+++ mm4-2.6.0-test9-2/mm/page_alloc.c 2003-11-19 00:13:11.000000000 -0800
@@ -238,8 +238,7 @@ static inline void free_pages_check(cons
* And clear the zone's pages_scanned counter, to hold off the "all pages are
* pinned" detection logic.
*/
-static int
-free_pages_bulk(struct zone *zone, int count,
+int free_pages_bulk(struct zone *zone, int count,
struct list_head *list, unsigned int order)
{
unsigned long mask, flags;
diff -prauN mm4-2.6.0-test9-1/mm/vmscan.c mm4-2.6.0-test9-2/mm/vmscan.c
--- mm4-2.6.0-test9-1/mm/vmscan.c 2003-11-19 00:07:15.000000000 -0800
+++ mm4-2.6.0-test9-2/mm/vmscan.c 2003-11-19 00:09:43.000000000 -0800
@@ -837,6 +837,10 @@ shrink_caches(struct zone *classzone, in
}
return ret;
}
+
+#ifndef HAVE_ARCH_PAGETABLE_CACHE
+#define shrink_pagetable_cache(gfp_mask) do { } while (0)
+#endif
/*
* This is the main entry point to direct page reclaim.
@@ -890,6 +894,9 @@ int try_to_free_pages(struct zone *cz,
*/
wakeup_bdflush(total_scanned);
+ /* shoot down some pagetable caches before napping */
+ shrink_pagetable_cache(gfp_mask);
+
/* Take a nap, wait for some writeback to complete */
blk_congestion_wait(WRITE, HZ/10);
if (cz - cz->zone_pgdat->node_zones < ZONE_HIGHMEM) {
@@ -981,8 +988,10 @@ static int balance_pgdat(pg_data_t *pgda
}
if (all_zones_ok)
break;
- if (to_free > 0)
+ if (to_free > 0) {
+ shrink_pagetable_cache(GFP_HIGHUSER);
blk_congestion_wait(WRITE, HZ/10);
+ }
}
for (i = 0; i < pgdat->nr_zones; i++) {
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"aart@kvack.org"> aart@kvack.org </a>
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: 2.6.0-test9-mm4
2003-11-19 9:02 ` 2.6.0-test9-mm4 William Lee Irwin III
@ 2003-11-19 9:19 ` Andrew Morton
2003-11-19 9:33 ` 2.6.0-test9-mm4 William Lee Irwin III
0 siblings, 1 reply; 8+ messages in thread
From: Andrew Morton @ 2003-11-19 9:19 UTC (permalink / raw)
To: William Lee Irwin III; +Cc: linux-kernel, linux-mm
William Lee Irwin III <wli@holomorphy.com> wrote:
>
> On Tue, Nov 18, 2003 at 10:51:20PM -0800, Andrew Morton wrote:
> > ftp://ftp.kernel.org/pub/linux/kernel/people/akpm/patches/2.6/2.6.0-test9/2.6.0-test9-mm4/
> > . Several fixes against patches which are only in -mm at present.
> > . Minor fixes which we'll queue for post-2.6.0.
> > . The interactivity problems which the ACPI PM timer patch showed up
> > should be fixed here - please sing out if not.
>
> I'm not sure if this is within the scope of current efforts, but I
> gave it a shot just to see how bad untangling it from highpmd and
> O(1) buffered_rmqueue() was. It turns out it wasn't that hard.
>
> The codebase (so to speak) has been in regular use since June, though
> the port to -mm only lightly tested (basically testbooted on a laptop).
Any performance numbers?
> There is some minor core impact.
hm, big.
> +#ifdef CONFIG_SMP
> +#define smp_local_irq_save(x) local_irq_save(x)
> +#define smp_local_irq_restore(x) local_irq_restore(x)
> +#define smp_local_irq_disable() local_irq_disable()
> +#define smp_local_irq_enable() local_irq_enable()
> +#else
> +#define smp_local_irq_save(x) do { (void)(x); } while (0)
> +#define smp_local_irq_restore(x) do { (void)(x); } while (0)
> +#define smp_local_irq_disable() do { } while (0)
> +#define smp_local_irq_enable() do { } while (0)
> +#endif /* CONFIG_SMP */
Interesting.
> @@ -890,6 +894,9 @@ int try_to_free_pages(struct zone *cz,
> */
> wakeup_bdflush(total_scanned);
>
> + /* shoot down some pagetable caches before napping */
> + shrink_pagetable_cache(gfp_mask);
Maybe this could hook into the shrink_slab() mechanism? There's actually
nothing slab-specific about shrink_slab().
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"aart@kvack.org"> aart@kvack.org </a>
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: 2.6.0-test9-mm4
2003-11-19 9:19 ` 2.6.0-test9-mm4 Andrew Morton
@ 2003-11-19 9:33 ` William Lee Irwin III
2003-11-19 10:13 ` 2.6.0-test9-mm4 William Lee Irwin III
0 siblings, 1 reply; 8+ messages in thread
From: William Lee Irwin III @ 2003-11-19 9:33 UTC (permalink / raw)
To: Andrew Morton; +Cc: linux-kernel, linux-mm
William Lee Irwin III <wli@holomorphy.com> wrote:
>> I'm not sure if this is within the scope of current efforts, but I
>> gave it a shot just to see how bad untangling it from highpmd and
>> O(1) buffered_rmqueue() was. It turns out it wasn't that hard.
>> The codebase (so to speak) has been in regular use since June, though
>> the port to -mm only lightly tested (basically testbooted on a laptop).
On Wed, Nov 19, 2003 at 01:19:51AM -0800, Andrew Morton wrote:
> Any performance numbers?
I've not done rigorous benchmarking of this, no. Presumably
microbenchmarks that utilize the pte cache without thrashing it would
save themselves one page zeroing per pagetable page after the first
iteration unless there's a bug in the cache flushing logic.
William Lee Irwin III <wli@holomorphy.com> wrote:
>> +#ifdef CONFIG_SMP
>> +#define smp_local_irq_save(x) local_irq_save(x)
>> +#define smp_local_irq_restore(x) local_irq_restore(x)
>> +#define smp_local_irq_disable() local_irq_disable()
>> +#define smp_local_irq_enable() local_irq_enable()
>> +#else
>> +#define smp_local_irq_save(x) do { (void)(x); } while (0)
>> +#define smp_local_irq_restore(x) do { (void)(x); } while (0)
>> +#define smp_local_irq_disable() do { } while (0)
>> +#define smp_local_irq_enable() do { } while (0)
>> +#endif /* CONFIG_SMP */
On Wed, Nov 19, 2003 at 01:19:51AM -0800, Andrew Morton wrote:
> Interesting.
This was a micro-optimization for UP; the SMP case needs to protect
against reentry via interrupts due to smp_call_function(). UP can
just disable preemption. In principle, the two cases could be made
uniform at the cost of disabling interrupts unnecessarily on UP.
William Lee Irwin III <wli@holomorphy.com> wrote:
>> @@ -890,6 +894,9 @@ int try_to_free_pages(struct zone *cz,
>> */
>> wakeup_bdflush(total_scanned);
>>
>> + /* shoot down some pagetable caches before napping */
>> + shrink_pagetable_cache(gfp_mask);
On Wed, Nov 19, 2003 at 01:19:51AM -0800, Andrew Morton wrote:
> Maybe this could hook into the shrink_slab() mechanism? There's actually
> nothing slab-specific about shrink_slab().
There are some bootstrap ordering issues, but they're tractable. One
oddity is that in the highpte case, shrink_slab() will be skipped, but
the pagetable cache highmem-allocated. I'm not sure whether that's
important or not, but I erred on the side of caution.
Maybe I should slap a copyright down on arch/i386/mm/pgtable.c; I
appear to have written a substantial chunk of the code in there, too.
-- wli
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"aart@kvack.org"> aart@kvack.org </a>
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: 2.6.0-test9-mm4
2003-11-19 9:33 ` 2.6.0-test9-mm4 William Lee Irwin III
@ 2003-11-19 10:13 ` William Lee Irwin III
2003-11-19 10:34 ` 2.6.0-test9-mm4 William Lee Irwin III
0 siblings, 1 reply; 8+ messages in thread
From: William Lee Irwin III @ 2003-11-19 10:13 UTC (permalink / raw)
To: Andrew Morton, linux-kernel, linux-mm
William Lee Irwin III <wli@holomorphy.com> wrote:
>>> +#ifdef CONFIG_SMP
>>> +#define smp_local_irq_save(x) local_irq_save(x)
>>> +#define smp_local_irq_restore(x) local_irq_restore(x)
>>> +#define smp_local_irq_disable() local_irq_disable()
>>> +#define smp_local_irq_enable() local_irq_enable()
>>> +#else
[...]
On Wed, Nov 19, 2003 at 01:19:51AM -0800, Andrew Morton wrote:
>> Interesting.
On Wed, Nov 19, 2003 at 01:33:40AM -0800, William Lee Irwin III wrote:
> This was a micro-optimization for UP; the SMP case needs to protect
> against reentry via interrupts due to smp_call_function(). UP can
> just disable preemption. In principle, the two cases could be made
> uniform at the cost of disabling interrupts unnecessarily on UP.
The following, incremental atop the first, removes the smp_local_irq_*()
macros.
-- wli
diff -prauN mm4-2.6.0-test9-2/arch/i386/mm/pgtable.c mm4-2.6.0-test9-3/arch/i386/mm/pgtable.c
--- mm4-2.6.0-test9-2/arch/i386/mm/pgtable.c 2003-11-19 00:22:54.000000000 -0800
+++ mm4-2.6.0-test9-3/arch/i386/mm/pgtable.c 2003-11-19 02:07:13.000000000 -0800
@@ -177,7 +177,7 @@ static inline struct page *pte_alloc_rea
unsigned long flags;
struct page *page = NULL;
- smp_local_irq_save(flags);
+ local_irq_save(flags);
if (tlb->nr_pte_ready) {
int z;
for (z = MAX_ZONE_ID - 1; z >= 0; --z) {
@@ -194,7 +194,7 @@ static inline struct page *pte_alloc_rea
tlb->ready_count[z]--;
tlb->nr_pte_ready--;
}
- smp_local_irq_restore(flags);
+ local_irq_restore(flags);
put_cpu();
return page;
}
@@ -381,7 +381,7 @@ static void shrink_cpu_pagetable_cache(v
high = !!(gfp_mask & __GFP_HIGHMEM);
cpu = get_cpu();
tlb = &per_cpu(mmu_gathers, cpu);
- smp_local_irq_save(flags);
+ local_irq_save(flags);
if (tlb->nr_pte_active)
tlb_flush(tlb);
@@ -417,7 +417,7 @@ static void shrink_cpu_pagetable_cache(v
tlb->ready_count[zone] = 0;
}
- smp_local_irq_restore(flags);
+ local_irq_restore(flags);
put_cpu();
}
diff -prauN mm4-2.6.0-test9-2/include/asm-i386/system.h mm4-2.6.0-test9-3/include/asm-i386/system.h
--- mm4-2.6.0-test9-2/include/asm-i386/system.h 2003-11-19 00:09:43.000000000 -0800
+++ mm4-2.6.0-test9-3/include/asm-i386/system.h 2003-11-19 02:06:11.000000000 -0800
@@ -461,18 +461,6 @@ struct alt_instr {
/* For spinlocks etc */
#define local_irq_save(x) __asm__ __volatile__("pushfl ; popl %0 ; cli":"=g" (x): /* no input */ :"memory")
-#ifdef CONFIG_SMP
-#define smp_local_irq_save(x) local_irq_save(x)
-#define smp_local_irq_restore(x) local_irq_restore(x)
-#define smp_local_irq_disable() local_irq_disable()
-#define smp_local_irq_enable() local_irq_enable()
-#else
-#define smp_local_irq_save(x) do { (void)(x); } while (0)
-#define smp_local_irq_restore(x) do { (void)(x); } while (0)
-#define smp_local_irq_disable() do { } while (0)
-#define smp_local_irq_enable() do { } while (0)
-#endif /* CONFIG_SMP */
-
/*
* disable hlt during certain critical i/o operations
*/
diff -prauN mm4-2.6.0-test9-2/include/asm-i386/tlb.h mm4-2.6.0-test9-3/include/asm-i386/tlb.h
--- mm4-2.6.0-test9-2/include/asm-i386/tlb.h 2003-11-19 00:23:35.000000000 -0800
+++ mm4-2.6.0-test9-3/include/asm-i386/tlb.h 2003-11-19 02:06:58.000000000 -0800
@@ -106,7 +106,7 @@ void tlb_flush_mmu(struct mmu_gather *tl
tlb->need_flush = 0;
tlb_flush(tlb);
- smp_local_irq_save(flags);
+ local_irq_save(flags);
if (tlb->nr_nonpte) {
free_pages_and_swap_cache(tlb->nonpte, tlb->nr_nonpte);
@@ -126,7 +126,7 @@ void tlb_flush_mmu(struct mmu_gather *tl
if (tlb->nr_pte_ready >= NR_PTE)
tlb_flush_ready(tlb);
- smp_local_irq_restore(flags);
+ local_irq_restore(flags);
}
static inline
@@ -163,13 +163,13 @@ void tlb_remove_page(struct mmu_gather *
{
unsigned long flags;
- smp_local_irq_save(flags);
+ local_irq_save(flags);
tlb->need_flush = 1;
if (PagePTE(page))
tlb_remove_pte_page(tlb, page);
else
tlb_remove_nonpte_page(tlb, page);
- smp_local_irq_restore(flags);
+ local_irq_restore(flags);
}
#endif /* _I386_TLB_H */
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"aart@kvack.org"> aart@kvack.org </a>
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: 2.6.0-test9-mm4
2003-11-19 10:13 ` 2.6.0-test9-mm4 William Lee Irwin III
@ 2003-11-19 10:34 ` William Lee Irwin III
2003-11-19 10:50 ` 2.6.0-test9-mm4 William Lee Irwin III
0 siblings, 1 reply; 8+ messages in thread
From: William Lee Irwin III @ 2003-11-19 10:34 UTC (permalink / raw)
To: Andrew Morton, linux-kernel, linux-mm
On Wed, Nov 19, 2003 at 01:33:40AM -0800, William Lee Irwin III wrote:
>> This was a micro-optimization for UP; the SMP case needs to protect
>> against reentry via interrupts due to smp_call_function(). UP can
>> just disable preemption. In principle, the two cases could be made
>> uniform at the cost of disabling interrupts unnecessarily on UP.
On Wed, Nov 19, 2003 at 02:13:22AM -0800, William Lee Irwin III wrote:
> The following, incremental atop the first, removes the smp_local_irq_*()
> macros.
The following, incremental atop the smp_local_irq_*() removal, turns
shrink_pagetable_cache() into a set_shrinker()-registered shrinker_t.
I'm not entirely sure how good an idea this is given my prior remarks
about the vmscan.c code skipping shrink_slab() under highmem pressure.
Maybe the proper solution is teaching true slab shrinkers to honor
the gfp_mask argument?
This is also untested (apart from compiletesting).
-- wli
diff -prauN mm4-2.6.0-test9-3/arch/i386/mm/pgtable.c mm4-2.6.0-test9-4/arch/i386/mm/pgtable.c
--- mm4-2.6.0-test9-3/arch/i386/mm/pgtable.c 2003-11-19 02:07:13.000000000 -0800
+++ mm4-2.6.0-test9-4/arch/i386/mm/pgtable.c 2003-11-19 02:26:04.000000000 -0800
@@ -13,6 +13,7 @@
#include <linux/slab.h>
#include <linux/pagemap.h>
#include <linux/spinlock.h>
+#include <linux/init.h>
#include <asm/system.h>
#include <asm/pgtable.h>
@@ -421,7 +422,7 @@ static void shrink_cpu_pagetable_cache(v
put_cpu();
}
-void shrink_pagetable_cache(int gfp_mask)
+static int shrink_pagetable_cache(int nr_to_scan, unsigned int gfp_mask)
{
BUG_ON(irqs_disabled());
@@ -432,4 +433,13 @@ void shrink_pagetable_cache(int gfp_mask
smp_call_function(shrink_cpu_pagetable_cache, (void *)gfp_mask, 1, 1);
preempt_enable();
+ return 1;
}
+
+static __init int init_pagetable_cache_shrinker(void)
+{
+ set_shrinker(1, shrink_pagetable_cache);
+ return 0;
+}
+
+__initcall(init_pagetable_cache_shrinker);
diff -prauN mm4-2.6.0-test9-3/include/asm-i386/pgtable.h mm4-2.6.0-test9-4/include/asm-i386/pgtable.h
--- mm4-2.6.0-test9-3/include/asm-i386/pgtable.h 2003-11-19 00:09:43.000000000 -0800
+++ mm4-2.6.0-test9-4/include/asm-i386/pgtable.h 2003-11-19 02:24:14.000000000 -0800
@@ -44,9 +44,6 @@ void pgtable_cache_init(void);
void paging_init(void);
void setup_identity_mappings(pgd_t *pgd_base, unsigned long start, unsigned long end);
-#define HAVE_ARCH_PAGETABLE_CACHE
-void shrink_pagetable_cache(int gfp_mask);
-
#endif /* !__ASSEMBLY__ */
/*
diff -prauN mm4-2.6.0-test9-3/mm/vmscan.c mm4-2.6.0-test9-4/mm/vmscan.c
--- mm4-2.6.0-test9-3/mm/vmscan.c 2003-11-19 00:09:43.000000000 -0800
+++ mm4-2.6.0-test9-4/mm/vmscan.c 2003-11-19 02:15:43.000000000 -0800
@@ -838,10 +838,6 @@ shrink_caches(struct zone *classzone, in
return ret;
}
-#ifndef HAVE_ARCH_PAGETABLE_CACHE
-#define shrink_pagetable_cache(gfp_mask) do { } while (0)
-#endif
-
/*
* This is the main entry point to direct page reclaim.
*
@@ -894,9 +890,6 @@ int try_to_free_pages(struct zone *cz,
*/
wakeup_bdflush(total_scanned);
- /* shoot down some pagetable caches before napping */
- shrink_pagetable_cache(gfp_mask);
-
/* Take a nap, wait for some writeback to complete */
blk_congestion_wait(WRITE, HZ/10);
if (cz - cz->zone_pgdat->node_zones < ZONE_HIGHMEM) {
@@ -988,10 +981,8 @@ static int balance_pgdat(pg_data_t *pgda
}
if (all_zones_ok)
break;
- if (to_free > 0) {
- shrink_pagetable_cache(GFP_HIGHUSER);
+ if (to_free > 0)
blk_congestion_wait(WRITE, HZ/10);
- }
}
for (i = 0; i < pgdat->nr_zones; i++) {
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"aart@kvack.org"> aart@kvack.org </a>
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: 2.6.0-test9-mm4
2003-11-19 10:34 ` 2.6.0-test9-mm4 William Lee Irwin III
@ 2003-11-19 10:50 ` William Lee Irwin III
0 siblings, 0 replies; 8+ messages in thread
From: William Lee Irwin III @ 2003-11-19 10:50 UTC (permalink / raw)
To: Andrew Morton, linux-kernel, linux-mm
On Wed, Nov 19, 2003 at 02:34:19AM -0800, William Lee Irwin III wrote:
> The following, incremental atop the smp_local_irq_*() removal, turns
> shrink_pagetable_cache() into a set_shrinker()-registered shrinker_t.
> I'm not entirely sure how good an idea this is given my prior remarks
> about the vmscan.c code skipping shrink_slab() under highmem pressure.
> Maybe the proper solution is teaching true slab shrinkers to honor
> the gfp_mask argument?
> This is also untested (apart from compiletesting).
If any of this goes anywhere, I probably deserve a wee bit of credit
for getting it done (well, I did put some time into it). Here's me
patting myself on the back, incremental atop the previous two.
-- wli
diff -prauN mm4-2.6.0-test9-4/arch/i386/mm/pgtable.c mm4-2.6.0-test9-5/arch/i386/mm/pgtable.c
--- mm4-2.6.0-test9-4/arch/i386/mm/pgtable.c 2003-11-19 02:26:04.000000000 -0800
+++ mm4-2.6.0-test9-5/arch/i386/mm/pgtable.c 2003-11-19 02:46:50.000000000 -0800
@@ -1,5 +1,6 @@
/*
* linux/arch/i386/mm/pgtable.c
+ * highpte-compatible pte cacheing, William Irwin, IBM, June 2003
*/
#include <linux/config.h>
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"aart@kvack.org"> aart@kvack.org </a>
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: 2.6.0-test9-mm4
2003-11-19 6:51 2.6.0-test9-mm4 Andrew Morton
2003-11-19 9:02 ` 2.6.0-test9-mm4 William Lee Irwin III
@ 2003-11-19 11:13 ` Gene Heskett
1 sibling, 0 replies; 8+ messages in thread
From: Gene Heskett @ 2003-11-19 11:13 UTC (permalink / raw)
To: Andrew Morton, linux-kernel, linux-mm
On Wednesday 19 November 2003 01:51, Andrew Morton wrote:
>ftp://ftp.kernel.org/pub/linux/kernel/people/akpm/patches/2.6/2.6.0-
>test9/2.6.0-test9-mm4/
>
>
>. Several fixes against patches which are only in -mm at present.
>
>. Minor fixes which we'll queue for post-2.6.0.
>
>. The interactivity problems which the ACPI PM timer patch showed up
> should be fixed here - please sing out if not.
>
Here, I've rebooted to various elevators and run each for at least a
day, and for mm3, I'd have to say that the diffs are tolerable, but
the smoothest, most responsive is the deadline version. as still
gives an occasional 20 millisecond stutter, and cfq might be 10
milliseconds. Even as is a far cry from the near show stopper 15 to
20 second hangs of the performance in the later 2.4's. Great work
guys!
[...]
--
Cheers, Gene
AMD K6-III@500mhz 320M
Athlon1600XP@1400mhz 512M
99.27% setiathome rank, not too shabby for a WV hillbilly
Yahoo.com attornies please note, additions to this message
by Gene Heskett are:
Copyright 2003 by Maurice Eugene Heskett, all rights reserved.
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"aart@kvack.org"> aart@kvack.org </a>
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2003-11-19 11:13 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-11-19 6:51 2.6.0-test9-mm4 Andrew Morton
2003-11-19 9:02 ` 2.6.0-test9-mm4 William Lee Irwin III
2003-11-19 9:19 ` 2.6.0-test9-mm4 Andrew Morton
2003-11-19 9:33 ` 2.6.0-test9-mm4 William Lee Irwin III
2003-11-19 10:13 ` 2.6.0-test9-mm4 William Lee Irwin III
2003-11-19 10:34 ` 2.6.0-test9-mm4 William Lee Irwin III
2003-11-19 10:50 ` 2.6.0-test9-mm4 William Lee Irwin III
2003-11-19 11:13 ` 2.6.0-test9-mm4 Gene Heskett
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox