Merge branch 'akpm' (incoming from Andrew)

Merge more incoming from Andrew Morton:

 - Various fixes which were stalled or which I picked up recently

 - A large rotorooting of the AIO code.  Allegedly to improve
   performance but I don't really have good performance numbers (I might
   have lost the email) and I can't raise Kent today.  I held this out
   of 3.9 and we could give it another cycle if it's all too late/scary.

I ended up taking only the first two thirds of the AIO rotorooting.  I
left the percpu parts and the batch completion for later.  - Linus

* emailed patches from Andrew Morton <akpm@linux-foundation.org>: (33 commits)
  aio: don't include aio.h in sched.h
  aio: kill ki_retry
  aio: kill ki_key
  aio: give shared kioctx fields their own cachelines
  aio: kill struct aio_ring_info
  aio: kill batch allocation
  aio: change reqs_active to include unreaped completions
  aio: use cancellation list lazily
  aio: use flush_dcache_page()
  aio: make aio_read_evt() more efficient, convert to hrtimers
  wait: add wait_event_hrtimeout()
  aio: refcounting cleanup
  aio: make aio_put_req() lockless
  aio: do fget() after aio_get_req()
  aio: dprintk() -> pr_debug()
  aio: move private stuff out of aio.h
  aio: add kiocb_cancel()
  aio: kill return value of aio_complete()
  char: add aio_{read,write} to /dev/{null,zero}
  aio: remove retry-based AIO
  ...
This commit is contained in:
Linus Torvalds
2013-05-07 20:49:51 -07:00
89 changed files with 908 additions and 1372 deletions
+3 -1
View File
@@ -480,7 +480,9 @@ memory.stat file includes following statistics
# per-memory cgroup local status # per-memory cgroup local status
cache - # of bytes of page cache memory. cache - # of bytes of page cache memory.
rss - # of bytes of anonymous and swap cache memory. rss - # of bytes of anonymous and swap cache memory (includes
transparent hugepages).
rss_huge - # of bytes of anonymous transparent hugepages.
mapped_file - # of bytes of mapped file (includes tmpfs/shmem) mapped_file - # of bytes of mapped file (includes tmpfs/shmem)
pgpgin - # of charging events to the memory cgroup. The charging pgpgin - # of charging events to the memory cgroup. The charging
event happens each time a page is accounted as either mapped event happens each time a page is accounted as either mapped
+1
View File
@@ -21,6 +21,7 @@
#include <linux/module.h> #include <linux/module.h>
#include <linux/seq_file.h> #include <linux/seq_file.h>
#include <linux/mount.h> #include <linux/mount.h>
#include <linux/aio.h>
#include <asm/ebcdic.h> #include <asm/ebcdic.h>
#include "hypfs.h" #include "hypfs.h"
+3 -12
View File
@@ -253,24 +253,15 @@ void __init leon_smp_done(void)
/* Free unneeded trap tables */ /* Free unneeded trap tables */
if (!cpu_present(1)) { if (!cpu_present(1)) {
ClearPageReserved(virt_to_page(&trapbase_cpu1)); free_reserved_page(virt_to_page(&trapbase_cpu1));
init_page_count(virt_to_page(&trapbase_cpu1));
free_page((unsigned long)&trapbase_cpu1);
totalram_pages++;
num_physpages++; num_physpages++;
} }
if (!cpu_present(2)) { if (!cpu_present(2)) {
ClearPageReserved(virt_to_page(&trapbase_cpu2)); free_reserved_page(virt_to_page(&trapbase_cpu2));
init_page_count(virt_to_page(&trapbase_cpu2));
free_page((unsigned long)&trapbase_cpu2);
totalram_pages++;
num_physpages++; num_physpages++;
} }
if (!cpu_present(3)) { if (!cpu_present(3)) {
ClearPageReserved(virt_to_page(&trapbase_cpu3)); free_reserved_page(virt_to_page(&trapbase_cpu3));
init_page_count(virt_to_page(&trapbase_cpu3));
free_page((unsigned long)&trapbase_cpu3);
totalram_pages++;
num_physpages++; num_physpages++;
} }
/* Ok, they are spinning and ready to go. */ /* Ok, they are spinning and ready to go. */
+3 -34
View File
@@ -366,45 +366,14 @@ void __init mem_init(void)
void free_initmem (void) void free_initmem (void)
{ {
unsigned long addr; num_physpages += free_initmem_default(POISON_FREE_INITMEM);
unsigned long freed;
addr = (unsigned long)(&__init_begin);
freed = (unsigned long)(&__init_end) - addr;
for (; addr < (unsigned long)(&__init_end); addr += PAGE_SIZE) {
struct page *p;
memset((void *)addr, POISON_FREE_INITMEM, PAGE_SIZE);
p = virt_to_page(addr);
ClearPageReserved(p);
init_page_count(p);
__free_page(p);
totalram_pages++;
num_physpages++;
}
printk(KERN_INFO "Freeing unused kernel memory: %ldk freed\n",
freed >> 10);
} }
#ifdef CONFIG_BLK_DEV_INITRD #ifdef CONFIG_BLK_DEV_INITRD
void free_initrd_mem(unsigned long start, unsigned long end) void free_initrd_mem(unsigned long start, unsigned long end)
{ {
if (start < end) num_physpages += free_reserved_area(start, end, POISON_FREE_INITMEM,
printk(KERN_INFO "Freeing initrd memory: %ldk freed\n", "initrd");
(end - start) >> 10);
for (; start < end; start += PAGE_SIZE) {
struct page *p;
memset((void *)start, POISON_FREE_INITMEM, PAGE_SIZE);
p = virt_to_page(start);
ClearPageReserved(p);
init_page_count(p);
__free_page(p);
totalram_pages++;
num_physpages++;
}
} }
#endif #endif
+6 -22
View File
@@ -2059,8 +2059,7 @@ void __init mem_init(void)
/* We subtract one to account for the mem_map_zero page /* We subtract one to account for the mem_map_zero page
* allocated below. * allocated below.
*/ */
totalram_pages -= 1; num_physpages = totalram_pages - 1;
num_physpages = totalram_pages;
/* /*
* Set up the zero page, mark it reserved, so that page count * Set up the zero page, mark it reserved, so that page count
@@ -2071,7 +2070,7 @@ void __init mem_init(void)
prom_printf("paging_init: Cannot alloc zero page.\n"); prom_printf("paging_init: Cannot alloc zero page.\n");
prom_halt(); prom_halt();
} }
SetPageReserved(mem_map_zero); mark_page_reserved(mem_map_zero);
codepages = (((unsigned long) _etext) - ((unsigned long) _start)); codepages = (((unsigned long) _etext) - ((unsigned long) _start));
codepages = PAGE_ALIGN(codepages) >> PAGE_SHIFT; codepages = PAGE_ALIGN(codepages) >> PAGE_SHIFT;
@@ -2111,37 +2110,22 @@ void free_initmem(void)
initend = (unsigned long)(__init_end) & PAGE_MASK; initend = (unsigned long)(__init_end) & PAGE_MASK;
for (; addr < initend; addr += PAGE_SIZE) { for (; addr < initend; addr += PAGE_SIZE) {
unsigned long page; unsigned long page;
struct page *p;
page = (addr + page = (addr +
((unsigned long) __va(kern_base)) - ((unsigned long) __va(kern_base)) -
((unsigned long) KERNBASE)); ((unsigned long) KERNBASE));
memset((void *)addr, POISON_FREE_INITMEM, PAGE_SIZE); memset((void *)addr, POISON_FREE_INITMEM, PAGE_SIZE);
if (do_free) { if (do_free)
p = virt_to_page(page); free_reserved_page(virt_to_page(page));
ClearPageReserved(p);
init_page_count(p);
__free_page(p);
totalram_pages++;
}
} }
} }
#ifdef CONFIG_BLK_DEV_INITRD #ifdef CONFIG_BLK_DEV_INITRD
void free_initrd_mem(unsigned long start, unsigned long end) void free_initrd_mem(unsigned long start, unsigned long end)
{ {
if (start < end) num_physpages += free_reserved_area(start, end, POISON_FREE_INITMEM,
printk ("Freeing initrd memory: %ldk freed\n", (end - start) >> 10); "initrd");
for (; start < end; start += PAGE_SIZE) {
struct page *p = virt_to_page(start);
ClearPageReserved(p);
init_page_count(p);
__free_page(p);
totalram_pages++;
}
} }
#endif #endif
+1
View File
@@ -27,6 +27,7 @@
#include <linux/ratelimit.h> #include <linux/ratelimit.h>
#include <linux/slab.h> #include <linux/slab.h>
#include <linux/times.h> #include <linux/times.h>
#include <linux/uio.h>
#include <asm/uaccess.h> #include <asm/uaccess.h>
#include <scsi/scsi.h> #include <scsi/scsi.h>
+36
View File
@@ -28,6 +28,7 @@
#include <linux/pfn.h> #include <linux/pfn.h>
#include <linux/export.h> #include <linux/export.h>
#include <linux/io.h> #include <linux/io.h>
#include <linux/aio.h>
#include <asm/uaccess.h> #include <asm/uaccess.h>
@@ -627,6 +628,18 @@ static ssize_t write_null(struct file *file, const char __user *buf,
return count; return count;
} }
static ssize_t aio_read_null(struct kiocb *iocb, const struct iovec *iov,
unsigned long nr_segs, loff_t pos)
{
return 0;
}
static ssize_t aio_write_null(struct kiocb *iocb, const struct iovec *iov,
unsigned long nr_segs, loff_t pos)
{
return iov_length(iov, nr_segs);
}
static int pipe_to_null(struct pipe_inode_info *info, struct pipe_buffer *buf, static int pipe_to_null(struct pipe_inode_info *info, struct pipe_buffer *buf,
struct splice_desc *sd) struct splice_desc *sd)
{ {
@@ -670,6 +683,24 @@ static ssize_t read_zero(struct file *file, char __user *buf,
return written ? written : -EFAULT; return written ? written : -EFAULT;
} }
static ssize_t aio_read_zero(struct kiocb *iocb, const struct iovec *iov,
unsigned long nr_segs, loff_t pos)
{
size_t written = 0;
unsigned long i;
ssize_t ret;
for (i = 0; i < nr_segs; i++) {
ret = read_zero(iocb->ki_filp, iov[i].iov_base, iov[i].iov_len,
&pos);
if (ret < 0)
break;
written += ret;
}
return written ? written : -EFAULT;
}
static int mmap_zero(struct file *file, struct vm_area_struct *vma) static int mmap_zero(struct file *file, struct vm_area_struct *vma)
{ {
#ifndef CONFIG_MMU #ifndef CONFIG_MMU
@@ -738,6 +769,7 @@ static int open_port(struct inode *inode, struct file *filp)
#define full_lseek null_lseek #define full_lseek null_lseek
#define write_zero write_null #define write_zero write_null
#define read_full read_zero #define read_full read_zero
#define aio_write_zero aio_write_null
#define open_mem open_port #define open_mem open_port
#define open_kmem open_mem #define open_kmem open_mem
#define open_oldmem open_mem #define open_oldmem open_mem
@@ -766,6 +798,8 @@ static const struct file_operations null_fops = {
.llseek = null_lseek, .llseek = null_lseek,
.read = read_null, .read = read_null,
.write = write_null, .write = write_null,
.aio_read = aio_read_null,
.aio_write = aio_write_null,
.splice_write = splice_write_null, .splice_write = splice_write_null,
}; };
@@ -782,6 +816,8 @@ static const struct file_operations zero_fops = {
.llseek = zero_lseek, .llseek = zero_lseek,
.read = read_zero, .read = read_zero,
.write = write_zero, .write = write_zero,
.aio_read = aio_read_zero,
.aio_write = aio_write_zero,
.mmap = mmap_zero, .mmap = mmap_zero,
}; };
+2 -2
View File
@@ -62,13 +62,13 @@ static int __cxio_init_resource_fifo(struct kfifo *fifo,
kfifo_in(fifo, (unsigned char *) &entry, sizeof(u32)); kfifo_in(fifo, (unsigned char *) &entry, sizeof(u32));
if (random) { if (random) {
j = 0; j = 0;
random_bytes = random32(); random_bytes = prandom_u32();
for (i = 0; i < RANDOM_SIZE; i++) for (i = 0; i < RANDOM_SIZE; i++)
rarray[i] = i + skip_low; rarray[i] = i + skip_low;
for (i = skip_low + RANDOM_SIZE; i < nr - skip_high; i++) { for (i = skip_low + RANDOM_SIZE; i < nr - skip_high; i++) {
if (j >= RANDOM_SIZE) { if (j >= RANDOM_SIZE) {
j = 0; j = 0;
random_bytes = random32(); random_bytes = prandom_u32();
} }
idx = (random_bytes >> (j * 2)) & 0xF; idx = (random_bytes >> (j * 2)) & 0xF;
kfifo_in(fifo, kfifo_in(fifo,
+2 -2
View File
@@ -54,7 +54,7 @@ u32 c4iw_id_alloc(struct c4iw_id_table *alloc)
if (obj < alloc->max) { if (obj < alloc->max) {
if (alloc->flags & C4IW_ID_TABLE_F_RANDOM) if (alloc->flags & C4IW_ID_TABLE_F_RANDOM)
alloc->last += random32() % RANDOM_SKIP; alloc->last += prandom_u32() % RANDOM_SKIP;
else else
alloc->last = obj + 1; alloc->last = obj + 1;
if (alloc->last >= alloc->max) if (alloc->last >= alloc->max)
@@ -88,7 +88,7 @@ int c4iw_id_table_alloc(struct c4iw_id_table *alloc, u32 start, u32 num,
alloc->start = start; alloc->start = start;
alloc->flags = flags; alloc->flags = flags;
if (flags & C4IW_ID_TABLE_F_RANDOM) if (flags & C4IW_ID_TABLE_F_RANDOM)
alloc->last = random32() % RANDOM_SKIP; alloc->last = prandom_u32() % RANDOM_SKIP;
else else
alloc->last = 0; alloc->last = 0;
alloc->max = num; alloc->max = num;
@@ -40,6 +40,7 @@
#include <linux/slab.h> #include <linux/slab.h>
#include <linux/highmem.h> #include <linux/highmem.h>
#include <linux/io.h> #include <linux/io.h>
#include <linux/aio.h>
#include <linux/jiffies.h> #include <linux/jiffies.h>
#include <linux/cpu.h> #include <linux/cpu.h>
#include <asm/pgtable.h> #include <asm/pgtable.h>
+1 -1
View File
@@ -93,7 +93,7 @@ static void __propagate_pkey_ev(struct mlx4_ib_dev *dev, int port_num,
__be64 mlx4_ib_gen_node_guid(void) __be64 mlx4_ib_gen_node_guid(void)
{ {
#define NODE_GUID_HI ((u64) (((u64)IB_OPENIB_OUI) << 40)) #define NODE_GUID_HI ((u64) (((u64)IB_OPENIB_OUI) << 40))
return cpu_to_be64(NODE_GUID_HI | random32()); return cpu_to_be64(NODE_GUID_HI | prandom_u32());
} }
__be64 mlx4_ib_get_new_demux_tid(struct mlx4_ib_demux_ctx *ctx) __be64 mlx4_ib_get_new_demux_tid(struct mlx4_ib_demux_ctx *ctx)
+1 -1
View File
@@ -39,7 +39,7 @@
#include <linux/vmalloc.h> #include <linux/vmalloc.h>
#include <linux/highmem.h> #include <linux/highmem.h>
#include <linux/io.h> #include <linux/io.h>
#include <linux/uio.h> #include <linux/aio.h>
#include <linux/jiffies.h> #include <linux/jiffies.h>
#include <asm/pgtable.h> #include <asm/pgtable.h>
#include <linux/delay.h> #include <linux/delay.h>
+1 -1
View File
@@ -460,7 +460,7 @@ static int ipoib_cm_req_handler(struct ib_cm_id *cm_id, struct ib_cm_event *even
goto err_qp; goto err_qp;
} }
psn = random32() & 0xffffff; psn = prandom_u32() & 0xffffff;
ret = ipoib_cm_modify_rx_qp(dev, cm_id, p->qp, psn); ret = ipoib_cm_modify_rx_qp(dev, cm_id, p->qp, psn);
if (ret) if (ret)
goto err_modify; goto err_modify;
+2 -2
View File
@@ -4085,7 +4085,7 @@ static int cnic_cm_alloc_mem(struct cnic_dev *dev)
if (!cp->csk_tbl) if (!cp->csk_tbl)
return -ENOMEM; return -ENOMEM;
port_id = random32(); port_id = prandom_u32();
port_id %= CNIC_LOCAL_PORT_RANGE; port_id %= CNIC_LOCAL_PORT_RANGE;
if (cnic_init_id_tbl(&cp->csk_port_tbl, CNIC_LOCAL_PORT_RANGE, if (cnic_init_id_tbl(&cp->csk_port_tbl, CNIC_LOCAL_PORT_RANGE,
CNIC_LOCAL_PORT_MIN, port_id)) { CNIC_LOCAL_PORT_MIN, port_id)) {
@@ -4145,7 +4145,7 @@ static int cnic_cm_init_bnx2_hw(struct cnic_dev *dev)
{ {
u32 seed; u32 seed;
seed = random32(); seed = prandom_u32();
cnic_ctx_wr(dev, 45, 0, seed); cnic_ctx_wr(dev, 45, 0, seed);
return 0; return 0;
} }
+1 -1
View File
@@ -449,7 +449,7 @@ static int transmit(struct baycom_state *bc, int cnt, unsigned char stat)
if ((--bc->hdlctx.slotcnt) > 0) if ((--bc->hdlctx.slotcnt) > 0)
return 0; return 0;
bc->hdlctx.slotcnt = bc->ch_params.slottime; bc->hdlctx.slotcnt = bc->ch_params.slottime;
if ((random32() % 256) > bc->ch_params.ppersist) if ((prandom_u32() % 256) > bc->ch_params.ppersist)
return 0; return 0;
} }
} }
+1 -1
View File
@@ -389,7 +389,7 @@ void hdlcdrv_arbitrate(struct net_device *dev, struct hdlcdrv_state *s)
if ((--s->hdlctx.slotcnt) > 0) if ((--s->hdlctx.slotcnt) > 0)
return; return;
s->hdlctx.slotcnt = s->ch_params.slottime; s->hdlctx.slotcnt = s->ch_params.slottime;
if ((random32() % 256) > s->ch_params.ppersist) if ((prandom_u32() % 256) > s->ch_params.ppersist)
return; return;
start_tx(dev, s); start_tx(dev, s);
} }
+1 -1
View File
@@ -638,7 +638,7 @@ static void yam_arbitrate(struct net_device *dev)
yp->slotcnt = yp->slot / 10; yp->slotcnt = yp->slot / 10;
/* is random > persist ? */ /* is random > persist ? */
if ((random32() % 256) > yp->pers) if ((prandom_u32() % 256) > yp->pers)
return; return;
yam_start_tx(dev, yp); yam_start_tx(dev, yp);
+1 -1
View File
@@ -18,7 +18,7 @@
static u32 random_N(unsigned int N) static u32 random_N(unsigned int N)
{ {
return reciprocal_divide(random32(), N); return reciprocal_divide(prandom_u32(), N);
} }
static bool rnd_transmit(struct team *team, struct sk_buff *skb) static bool rnd_transmit(struct team *team, struct sk_buff *skb)
@@ -1117,7 +1117,7 @@ static void brcmf_p2p_afx_handler(struct work_struct *work)
if (afx_hdl->is_listen && afx_hdl->my_listen_chan) if (afx_hdl->is_listen && afx_hdl->my_listen_chan)
/* 100ms ~ 300ms */ /* 100ms ~ 300ms */
err = brcmf_p2p_discover_listen(p2p, afx_hdl->my_listen_chan, err = brcmf_p2p_discover_listen(p2p, afx_hdl->my_listen_chan,
100 * (1 + (random32() % 3))); 100 * (1 + prandom_u32() % 3));
else else
err = brcmf_p2p_act_frm_search(p2p, afx_hdl->peer_listen_chan); err = brcmf_p2p_act_frm_search(p2p, afx_hdl->peer_listen_chan);
+2 -2
View File
@@ -216,7 +216,7 @@ mwifiex_cfg80211_mgmt_tx(struct wiphy *wiphy, struct wireless_dev *wdev,
mwifiex_form_mgmt_frame(skb, buf, len); mwifiex_form_mgmt_frame(skb, buf, len);
mwifiex_queue_tx_pkt(priv, skb); mwifiex_queue_tx_pkt(priv, skb);
*cookie = random32() | 1; *cookie = prandom_u32() | 1;
cfg80211_mgmt_tx_status(wdev, *cookie, buf, len, true, GFP_ATOMIC); cfg80211_mgmt_tx_status(wdev, *cookie, buf, len, true, GFP_ATOMIC);
wiphy_dbg(wiphy, "info: management frame transmitted\n"); wiphy_dbg(wiphy, "info: management frame transmitted\n");
@@ -271,7 +271,7 @@ mwifiex_cfg80211_remain_on_channel(struct wiphy *wiphy,
duration); duration);
if (!ret) { if (!ret) {
*cookie = random32() | 1; *cookie = prandom_u32() | 1;
priv->roc_cfg.cookie = *cookie; priv->roc_cfg.cookie = *cookie;
priv->roc_cfg.chan = *chan; priv->roc_cfg.chan = *chan;

Some files were not shown because too many files have changed in this diff Show More