diff -prauN pgcl-2.6.0-test11-9/Documentation/filesystems/proc.txt pgcl-2.6.0-test11-10/Documentation/filesystems/proc.txt --- pgcl-2.6.0-test11-9/Documentation/filesystems/proc.txt 2003-11-26 12:43:28.000000000 -0800 +++ pgcl-2.6.0-test11-10/Documentation/filesystems/proc.txt 2003-12-02 01:24:17.000000000 -0800 @@ -900,6 +900,15 @@ super-nr shows the number of currently a Every mounted file system needs a super block, so if you plan to mount lots of file systems, you may want to increase these numbers. +aio-nr and aio-max-nr +--------------------- + +aio-nr is the running total of the number of events specified on the +io_setup system call for all currently active aio contexts. If aio-nr +reaches aio-max-nr then io_setup will fail with EAGAIN. Note that +raising aio-max-nr does not result in the pre-allocation or re-sizing +of any kernel data structures. + 2.2 /proc/sys/fs/binfmt_misc - Miscellaneous binary formats ----------------------------------------------------------- diff -prauN pgcl-2.6.0-test11-9/Documentation/sysctl/fs.txt pgcl-2.6.0-test11-10/Documentation/sysctl/fs.txt --- pgcl-2.6.0-test11-9/Documentation/sysctl/fs.txt 2003-11-26 12:42:47.000000000 -0800 +++ pgcl-2.6.0-test11-10/Documentation/sysctl/fs.txt 2003-12-02 01:24:17.000000000 -0800 @@ -138,3 +138,13 @@ thus the maximum number of mounted files can have. You only need to increase super-max if you need to mount more filesystems than the current value in super-max allows you to. + +============================================================== + +aio-nr & aio-max-nr: + +aio-nr shows the current system-wide number of asynchronous io +requests. aio-max-nr allows you to change the maximum value +aio-nr can grow to. + +============================================================== diff -prauN pgcl-2.6.0-test11-9/arch/i386/mm/highmem.c pgcl-2.6.0-test11-10/arch/i386/mm/highmem.c --- pgcl-2.6.0-test11-9/arch/i386/mm/highmem.c 2003-12-01 08:29:54.000000000 -0800 +++ pgcl-2.6.0-test11-10/arch/i386/mm/highmem.c 2003-12-02 18:25:03.000000000 -0800 @@ -139,6 +139,9 @@ unsigned long kmap_atomic_to_pfn(void *p if (vaddr < VMALLOC_START) return __pa(vaddr)/MMUPAGE_SIZE; + BUG_ON(vaddr > __fix_to_virt(FIX_KMAP_BEGIN)); + BUG_ON(vaddr < __fix_to_virt(FIX_KMAP_END)); + pgd = pgd_offset_k(vaddr); pmd = pmd_offset(pgd, vaddr); BUG_ON(pmd_none(*pmd)); diff -prauN pgcl-2.6.0-test11-9/drivers/char/agp/amd64-agp.c pgcl-2.6.0-test11-10/drivers/char/agp/amd64-agp.c --- pgcl-2.6.0-test11-9/drivers/char/agp/amd64-agp.c 2003-12-01 00:56:05.000000000 -0800 +++ pgcl-2.6.0-test11-10/drivers/char/agp/amd64-agp.c 2003-12-02 03:59:00.000000000 -0800 @@ -264,8 +264,8 @@ static int __devinit aperture_valid(u64 printk(KERN_ERR PFX "Aperture out of bounds\n"); return 0; } - pfn = aper >> PAGE_SHIFT; - for (c = 0; c < size/PAGE_SIZE; c++) { + pfn = aper >> MMUPAGE_SHIFT; + for (c = 0; c < size/MMUPAGE_SIZE; c++) { if (!pfn_valid(pfn + c)) break; if (!PageReserved(pfn_to_page(pfn + c))) { diff -prauN pgcl-2.6.0-test11-9/drivers/char/agp/generic.c pgcl-2.6.0-test11-10/drivers/char/agp/generic.c --- pgcl-2.6.0-test11-9/drivers/char/agp/generic.c 2003-12-01 00:56:05.000000000 -0800 +++ pgcl-2.6.0-test11-10/drivers/char/agp/generic.c 2003-12-02 04:22:34.000000000 -0800 @@ -257,7 +257,7 @@ int agp_num_entries(void) break; } - num_entries -= agp_memory_reserved>>PAGE_SHIFT; + num_entries -= agp_memory_reserved >> MMUPAGE_SHIFT; if (num_entries<0) num_entries = 0; return num_entries; @@ -744,11 +744,13 @@ int agp_generic_free_gatt_table(void) /* Do not worry about freeing memory, because if this is * called, then all agp memory is deallocated and removed - * from the table. */ + * from the table. + * page_order had better match... + */ iounmap(agp_bridge->gatt_table); table = (char *) agp_bridge->gatt_table_real; - table_end = table + ((MMUPAGE_SIZE * (1 << page_order)) - 1); + table_end = table + ((PAGE_SIZE << page_order) - 1); for (page = virt_to_page(table); page <= virt_to_page(table_end); page++) ClearPageReserved(page); diff -prauN pgcl-2.6.0-test11-9/drivers/char/drm/drm_memory.h pgcl-2.6.0-test11-10/drivers/char/drm/drm_memory.h --- pgcl-2.6.0-test11-9/drivers/char/drm/drm_memory.h 2003-11-30 21:44:25.000000000 -0800 +++ pgcl-2.6.0-test11-10/drivers/char/drm/drm_memory.h 2003-12-12 19:26:11.000000000 -0800 @@ -279,7 +279,7 @@ unsigned long DRM(alloc_pages)(int order for (addr = address, sz = bytes; sz > 0; addr += PAGE_SIZE, sz -= PAGE_SIZE) { - SetPageReserved(virt_to_page(addr)); + SetPageReserved(pfn_to_page(vmalloc_to_pfn((void *)addr))); } return address; @@ -307,7 +307,7 @@ void DRM(free_pages)(unsigned long addre for (addr = address, sz = bytes; sz > 0; addr += PAGE_SIZE, sz -= PAGE_SIZE) { - ClearPageReserved(virt_to_page(addr)); + ClearPageReserved(pfn_to_page(vmalloc_to_pfn((void *)addr))); } free_pages(address, order); diff -prauN pgcl-2.6.0-test11-9/drivers/char/drm/ffb_drv.c pgcl-2.6.0-test11-10/drivers/char/drm/ffb_drv.c --- pgcl-2.6.0-test11-9/drivers/char/drm/ffb_drv.c 2003-11-30 23:29:27.000000000 -0800 +++ pgcl-2.6.0-test11-10/drivers/char/drm/ffb_drv.c 2003-12-02 04:11:26.000000000 -0800 @@ -281,7 +281,7 @@ static unsigned long ffb_get_unmapped_ar unsigned long pgoff, unsigned long flags) { - drm_map_t *map = ffb_find_map(filp, pgoff << PAGE_SHIFT); + drm_map_t *map = ffb_find_map(filp, pgoff << MMUPAGE_SHIFT); unsigned long addr = -ENOMEM; if (!map) diff -prauN pgcl-2.6.0-test11-9/drivers/char/drm/radeon_cp.c pgcl-2.6.0-test11-10/drivers/char/drm/radeon_cp.c --- pgcl-2.6.0-test11-9/drivers/char/drm/radeon_cp.c 2003-11-28 23:36:17.000000000 -0800 +++ pgcl-2.6.0-test11-10/drivers/char/drm/radeon_cp.c 2003-12-02 04:04:53.000000000 -0800 @@ -897,7 +897,7 @@ static void radeon_cp_init_ring_buffer( unsigned long tmp_ofs, page_ofs; tmp_ofs = dev_priv->ring_rptr->offset - dev->sg->handle; - page_ofs = tmp_ofs >> PAGE_SHIFT; + page_ofs = tmp_ofs >> MMUPAGE_SHIFT; RADEON_WRITE( RADEON_CP_RB_RPTR_ADDR, entry->busaddr[page_ofs]); diff -prauN pgcl-2.6.0-test11-9/fs/aio.c pgcl-2.6.0-test11-10/fs/aio.c --- pgcl-2.6.0-test11-9/fs/aio.c 2003-11-27 21:55:19.000000000 -0800 +++ pgcl-2.6.0-test11-10/fs/aio.c 2003-12-02 04:43:21.000000000 -0800 @@ -187,8 +187,8 @@ static int aio_setup_ring(struct kioctx struct io_event *__event; \ unsigned long pfn; \ pfn = (info)->ring_pages[pos/AIO_EVENTS_PER_PAGE]; \ - __event = kmap_atomic(pfn_to_page(pfn), km); \ - __event += (pfn % PAGE_MMUCOUNT) * MMUPAGE_SIZE; \ + __event = (void *)((char *)kmap_atomic(pfn_to_page(pfn), km) \ + + MMUPAGE_SIZE * (pfn % PAGE_MMUCOUNT)); \ __event += pos % AIO_EVENTS_PER_PAGE; \ __event; \ }) diff -prauN pgcl-2.6.0-test11-9/fs/proc/proc_misc.c pgcl-2.6.0-test11-10/fs/proc/proc_misc.c --- pgcl-2.6.0-test11-9/fs/proc/proc_misc.c 2003-11-30 12:50:32.000000000 -0800 +++ pgcl-2.6.0-test11-10/fs/proc/proc_misc.c 2003-12-02 00:42:13.000000000 -0800 @@ -231,8 +231,8 @@ static int meminfo_read_proc(char *page, vmtot, vmi.used, vmi.largest_chunk, - K(PAGE_SIZE), - K(MMUPAGE_SIZE) + PAGE_SIZE >> 10, + MMUPAGE_SIZE >> 10 ); len += hugetlb_report_meminfo(page + len); diff -prauN pgcl-2.6.0-test11-9/fs/ramfs/inode.c pgcl-2.6.0-test11-10/fs/ramfs/inode.c --- pgcl-2.6.0-test11-9/fs/ramfs/inode.c 2003-11-26 12:43:32.000000000 -0800 +++ pgcl-2.6.0-test11-10/fs/ramfs/inode.c 2003-12-02 01:59:44.000000000 -0800 @@ -31,6 +31,7 @@ #include #include #include +#include #include @@ -140,10 +141,30 @@ static int ramfs_symlink(struct inode * return error; } +static int nop_writepage(struct page *page, struct writeback_control *wbc) +{ + wbc->nr_to_write = 0; + return 0; +} + +static int nop_writepages(struct address_space *mapping, + struct writeback_control *wbc) +{ + return 0; +} + +static int nop_set_page_dirty(struct page *page) +{ + return 0; +} + static struct address_space_operations ramfs_aops = { .readpage = simple_readpage, .prepare_write = simple_prepare_write, - .commit_write = simple_commit_write + .commit_write = simple_commit_write, + .set_page_dirty = nop_set_page_dirty, + .writepage = nop_writepage, + .writepages = nop_writepages, }; static struct file_operations ramfs_file_operations = { @@ -153,6 +174,8 @@ static struct file_operations ramfs_file .fsync = simple_sync_file, .sendfile = generic_file_sendfile, .llseek = generic_file_llseek, + .aio_read = generic_file_aio_read, + .aio_write = generic_file_aio_write, }; static struct inode_operations ramfs_file_inode_operations = { diff -prauN pgcl-2.6.0-test11-9/include/asm-i386/highmem.h pgcl-2.6.0-test11-10/include/asm-i386/highmem.h --- pgcl-2.6.0-test11-9/include/asm-i386/highmem.h 2003-12-01 07:24:19.000000000 -0800 +++ pgcl-2.6.0-test11-10/include/asm-i386/highmem.h 2003-12-02 18:58:09.000000000 -0800 @@ -47,11 +47,44 @@ void kmap_atomic_sg(pte_t *[], pte_addr_ #ifndef CONFIG_DEBUG_HIGHMEM static inline void kunmap_atomic_sg(pte_t *ptes[], enum km_type type) { + unsigned long slotaddr; + enum fixed_addresses idx; + int k; + + idx = type + KM_TYPE_NR*smp_processor_id(); + slotaddr = __fix_to_virt(FIX_KMAP_END) + PAGE_SIZE*idx; + + for (k = 0; k < PAGE_MMUCOUNT; ++k) { + + unsigned long vaddr = (unsigned long)ptes[k]; + if (!vaddr) + continue; + else if (vaddr < VMALLOC_START) + continue; + else { + BUG_ON(vaddr < __fix_to_virt(FIX_KMAP_END)); + BUG_ON(vaddr > __fix_to_virt(FIX_KMAP_BEGIN)); + BUG_ON(vaddr < slotaddr); + BUG_ON(vaddr - slotaddr >= PAGE_SIZE); + } + } dec_preempt_count(); } static inline void kunmap_atomic(void *kvaddr, enum km_type type) { + unsigned long slotaddr, vaddr = (unsigned long)kvaddr; + enum fixed_addresses idx; + + idx = type + KM_TYPE_NR*smp_processor_id(); + slotaddr = __fix_to_virt(FIX_KMAP_END) + PAGE_SIZE*idx; + + if (vaddr >= VMALLOC_START) { + BUG_ON(vaddr < __fix_to_virt(FIX_KMAP_END)); + BUG_ON(vaddr > __fix_to_virt(FIX_KMAP_BEGIN)); + BUG_ON(vaddr < slotaddr); + BUG_ON(vaddr - slotaddr >= PAGE_SIZE); + } dec_preempt_count(); } #else diff -prauN pgcl-2.6.0-test11-9/include/linux/aio.h pgcl-2.6.0-test11-10/include/linux/aio.h --- pgcl-2.6.0-test11-9/include/linux/aio.h 2003-11-27 21:55:19.000000000 -0800 +++ pgcl-2.6.0-test11-10/include/linux/aio.h 2003-12-02 01:24:17.000000000 -0800 @@ -167,6 +167,7 @@ static inline struct kiocb *list_kiocb(s } /* for sysctl: */ -extern unsigned aio_max_nr, aio_max_size, aio_max_pinned; +extern atomic_t aio_nr; +extern unsigned aio_max_nr; #endif /* __LINUX__AIO_H */ diff -prauN pgcl-2.6.0-test11-9/include/linux/sysctl.h pgcl-2.6.0-test11-10/include/linux/sysctl.h --- pgcl-2.6.0-test11-9/include/linux/sysctl.h 2003-12-07 01:43:11.000000000 -0800 +++ pgcl-2.6.0-test11-10/include/linux/sysctl.h 2003-12-02 01:24:17.000000000 -0800 @@ -127,7 +127,6 @@ enum KERN_PANIC_ON_OOPS=57, /* int: whether we will panic on an oops */ KERN_HPPA_PWRSW=58, /* int: hppa soft-power enable */ KERN_HPPA_UNALIGNED=59, /* int: hppa unaligned-trap enable */ - KERN_SCHED_RUNAVG_INTERVAL=60, }; @@ -602,6 +601,8 @@ enum FS_LEASE_TIME=15, /* int: maximum time to wait for a lease break */ FS_DQSTATS=16, /* disc quota usage statistics */ FS_XFS=17, /* struct: control xfs parameters */ + FS_AIO_NR=18, /* current system-wide number of aio requests */ + FS_AIO_MAX_NR=19, /* system-wide maximum number of aio requests */ }; /* /proc/sys/fs/quota/ */ diff -prauN pgcl-2.6.0-test11-9/kernel/sysctl.c pgcl-2.6.0-test11-10/kernel/sysctl.c --- pgcl-2.6.0-test11-9/kernel/sysctl.c 2003-11-30 11:01:42.000000000 -0800 +++ pgcl-2.6.0-test11-10/kernel/sysctl.c 2003-12-02 01:24:17.000000000 -0800 @@ -794,6 +794,22 @@ static ctl_table fs_table[] = { .mode = 0644, .proc_handler = &proc_dointvec, }, + { + .ctl_name = FS_AIO_NR, + .procname = "aio-nr", + .data = &aio_nr, + .maxlen = sizeof(aio_nr), + .mode = 0444, + .proc_handler = &proc_dointvec, + }, + { + .ctl_name = FS_AIO_MAX_NR, + .procname = "aio-max-nr", + .data = &aio_max_nr, + .maxlen = sizeof(aio_max_nr), + .mode = 0644, + .proc_handler = &proc_dointvec, + }, { .ctl_name = 0 } };