From 5f954793ab7da3dd21d39670b1186c0ed9225efc Mon Sep 17 00:00:00 2001 From: Joel Becker Date: Wed, 29 Sep 2010 17:33:05 -0700 Subject: [PATCH] --- yaml --- r: 211151 b: refs/heads/master c: 1fc8a117865b54590acd773a55fbac9221b018f0 h: refs/heads/master i: 211149: 2a664e8ba549a4bfa383e1906b6092b5d07e5ab2 211147: 9e7957542f822c20bda1eef308b27918fa965a0a 211143: 37a2183cca5f5dfac55dae0b1febc97b912f5164 211135: a670d9ebe0e6d2f18374fe8c2c9b02ef4fc1f435 v: v3 --- [refs] | 2 +- trunk/drivers/dma/shdma.c | 3 +-- trunk/drivers/mfd/max8925-core.c | 13 ++++++----- trunk/drivers/mfd/wm831x-irq.c | 9 ++------ trunk/drivers/mtd/nand/omap2.c | 2 +- trunk/fs/ocfs2/symlink.c | 2 +- trunk/fs/xfs/xfs_log_cil.c | 12 +++-------- trunk/fs/xfs/xfs_log_priv.h | 37 ++++++++++++++------------------ trunk/include/linux/dmaengine.h | 2 +- 9 files changed, 32 insertions(+), 50 deletions(-) diff --git a/[refs] b/[refs] index 359249439baa..b3b3722e67d3 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 77f890223338c890fc33972673d2bd3a53061570 +refs/heads/master: 1fc8a117865b54590acd773a55fbac9221b018f0 diff --git a/trunk/drivers/dma/shdma.c b/trunk/drivers/dma/shdma.c index eb6b54dbb806..fb64cf36ba61 100644 --- a/trunk/drivers/dma/shdma.c +++ b/trunk/drivers/dma/shdma.c @@ -580,6 +580,7 @@ static struct dma_async_tx_descriptor *sh_dmae_prep_slave_sg( sh_chan = to_sh_chan(chan); param = chan->private; + slave_addr = param->config->addr; /* Someone calling slave DMA on a public channel? */ if (!param || !sg_len) { @@ -588,8 +589,6 @@ static struct dma_async_tx_descriptor *sh_dmae_prep_slave_sg( return NULL; } - slave_addr = param->config->addr; - /* * if (param != NULL), this is a successfully requested slave channel, * therefore param->config != NULL too. diff --git a/trunk/drivers/mfd/max8925-core.c b/trunk/drivers/mfd/max8925-core.c index 428377a5a6f5..04028a9ee082 100644 --- a/trunk/drivers/mfd/max8925-core.c +++ b/trunk/drivers/mfd/max8925-core.c @@ -429,25 +429,24 @@ static void max8925_irq_sync_unlock(unsigned int irq) irq_tsc = cache_tsc; for (i = 0; i < ARRAY_SIZE(max8925_irqs); i++) { irq_data = &max8925_irqs[i]; - /* 1 -- disable, 0 -- enable */ switch (irq_data->mask_reg) { case MAX8925_CHG_IRQ1_MASK: - irq_chg[0] &= ~irq_data->enable; + irq_chg[0] &= irq_data->enable; break; case MAX8925_CHG_IRQ2_MASK: - irq_chg[1] &= ~irq_data->enable; + irq_chg[1] &= irq_data->enable; break; case MAX8925_ON_OFF_IRQ1_MASK: - irq_on[0] &= ~irq_data->enable; + irq_on[0] &= irq_data->enable; break; case MAX8925_ON_OFF_IRQ2_MASK: - irq_on[1] &= ~irq_data->enable; + irq_on[1] &= irq_data->enable; break; case MAX8925_RTC_IRQ_MASK: - irq_rtc &= ~irq_data->enable; + irq_rtc &= irq_data->enable; break; case MAX8925_TSC_IRQ_MASK: - irq_tsc &= ~irq_data->enable; + irq_tsc &= irq_data->enable; break; default: dev_err(chip->dev, "wrong IRQ\n"); diff --git a/trunk/drivers/mfd/wm831x-irq.c b/trunk/drivers/mfd/wm831x-irq.c index 294183b6260b..7dabe4dbd373 100644 --- a/trunk/drivers/mfd/wm831x-irq.c +++ b/trunk/drivers/mfd/wm831x-irq.c @@ -394,13 +394,8 @@ static int wm831x_irq_set_type(unsigned int irq, unsigned int type) irq = irq - wm831x->irq_base; - if (irq < WM831X_IRQ_GPIO_1 || irq > WM831X_IRQ_GPIO_11) { - /* Ignore internal-only IRQs */ - if (irq >= 0 && irq < WM831X_NUM_IRQS) - return 0; - else - return -EINVAL; - } + if (irq < WM831X_IRQ_GPIO_1 || irq > WM831X_IRQ_GPIO_11) + return -EINVAL; switch (type) { case IRQ_TYPE_EDGE_BOTH: diff --git a/trunk/drivers/mtd/nand/omap2.c b/trunk/drivers/mtd/nand/omap2.c index 513e0a76a4a7..133d51528f8d 100644 --- a/trunk/drivers/mtd/nand/omap2.c +++ b/trunk/drivers/mtd/nand/omap2.c @@ -413,7 +413,7 @@ static inline int omap_nand_dma_transfer(struct mtd_info *mtd, void *addr, prefetch_status = gpmc_read_status(GPMC_PREFETCH_COUNT); } while (prefetch_status); /* disable and stop the PFPW engine */ - gpmc_prefetch_reset(info->gpmc_cs); + gpmc_prefetch_reset(); dma_unmap_single(&info->pdev->dev, dma_addr, len, dir); return 0; diff --git a/trunk/fs/ocfs2/symlink.c b/trunk/fs/ocfs2/symlink.c index 32499d213fc4..9975457c981f 100644 --- a/trunk/fs/ocfs2/symlink.c +++ b/trunk/fs/ocfs2/symlink.c @@ -128,7 +128,7 @@ static void *ocfs2_fast_follow_link(struct dentry *dentry, } /* Fast symlinks can't be large */ - len = strlen(target); + len = strnlen(target, ocfs2_fast_symlink_chars(inode->i_sb)); link = kzalloc(len + 1, GFP_NOFS); if (!link) { status = -ENOMEM; diff --git a/trunk/fs/xfs/xfs_log_cil.c b/trunk/fs/xfs/xfs_log_cil.c index 7e206fc1fa36..ed575fb4b495 100644 --- a/trunk/fs/xfs/xfs_log_cil.c +++ b/trunk/fs/xfs/xfs_log_cil.c @@ -405,15 +405,9 @@ xlog_cil_push( new_ctx = kmem_zalloc(sizeof(*new_ctx), KM_SLEEP|KM_NOFS); new_ctx->ticket = xlog_cil_ticket_alloc(log); - /* - * Lock out transaction commit, but don't block for background pushes - * unless we are well over the CIL space limit. See the definition of - * XLOG_CIL_HARD_SPACE_LIMIT() for the full explanation of the logic - * used here. - */ + /* lock out transaction commit, but don't block on background push */ if (!down_write_trylock(&cil->xc_ctx_lock)) { - if (!push_seq && - cil->xc_ctx->space_used < XLOG_CIL_HARD_SPACE_LIMIT(log)) + if (!push_seq) goto out_free_ticket; down_write(&cil->xc_ctx_lock); } @@ -428,7 +422,7 @@ xlog_cil_push( goto out_skip; /* check for a previously pushed seqeunce */ - if (push_seq && push_seq < cil->xc_ctx->sequence) + if (push_seq < cil->xc_ctx->sequence) goto out_skip; /* diff --git a/trunk/fs/xfs/xfs_log_priv.h b/trunk/fs/xfs/xfs_log_priv.h index edcdfe01617f..ced52b98b322 100644 --- a/trunk/fs/xfs/xfs_log_priv.h +++ b/trunk/fs/xfs/xfs_log_priv.h @@ -426,13 +426,13 @@ struct xfs_cil { }; /* - * The amount of log space we allow the CIL to aggregate is difficult to size. - * Whatever we choose, we have to make sure we can get a reservation for the - * log space effectively, that it is large enough to capture sufficient - * relogging to reduce log buffer IO significantly, but it is not too large for - * the log or induces too much latency when writing out through the iclogs. We - * track both space consumed and the number of vectors in the checkpoint - * context, so we need to decide which to use for limiting. + * The amount of log space we should the CIL to aggregate is difficult to size. + * Whatever we chose we have to make we can get a reservation for the log space + * effectively, that it is large enough to capture sufficient relogging to + * reduce log buffer IO significantly, but it is not too large for the log or + * induces too much latency when writing out through the iclogs. We track both + * space consumed and the number of vectors in the checkpoint context, so we + * need to decide which to use for limiting. * * Every log buffer we write out during a push needs a header reserved, which * is at least one sector and more for v2 logs. Hence we need a reservation of @@ -459,21 +459,16 @@ struct xfs_cil { * checkpoint transaction ticket is specific to the checkpoint context, rather * than the CIL itself. * - * With dynamic reservations, we can effectively make up arbitrary limits for - * the checkpoint size so long as they don't violate any other size rules. - * Recovery imposes a rule that no transaction exceed half the log, so we are - * limited by that. Furthermore, the log transaction reservation subsystem - * tries to keep 25% of the log free, so we need to keep below that limit or we - * risk running out of free log space to start any new transactions. - * - * In order to keep background CIL push efficient, we will set a lower - * threshold at which background pushing is attempted without blocking current - * transaction commits. A separate, higher bound defines when CIL pushes are - * enforced to ensure we stay within our maximum checkpoint size bounds. - * threshold, yet give us plenty of space for aggregation on large logs. + * With dynamic reservations, we can basically make up arbitrary limits for the + * checkpoint size so long as they don't violate any other size rules. Hence + * the initial maximum size for the checkpoint transaction will be set to a + * quarter of the log or 8MB, which ever is smaller. 8MB is an arbitrary limit + * right now based on the latency of writing out a large amount of data through + * the circular iclog buffers. */ -#define XLOG_CIL_SPACE_LIMIT(log) (log->l_logsize >> 3) -#define XLOG_CIL_HARD_SPACE_LIMIT(log) (3 * (log->l_logsize >> 4)) + +#define XLOG_CIL_SPACE_LIMIT(log) \ + (min((log->l_logsize >> 2), (8 * 1024 * 1024))) /* * The reservation head lsn is not made up of a cycle number and block number. diff --git a/trunk/include/linux/dmaengine.h b/trunk/include/linux/dmaengine.h index e2106495cc11..c61d4ca27bcc 100644 --- a/trunk/include/linux/dmaengine.h +++ b/trunk/include/linux/dmaengine.h @@ -548,7 +548,7 @@ static inline bool dma_dev_has_pq_continue(struct dma_device *dma) return (dma->max_pq & DMA_HAS_PQ_CONTINUE) == DMA_HAS_PQ_CONTINUE; } -static inline unsigned short dma_dev_to_maxpq(struct dma_device *dma) +static unsigned short dma_dev_to_maxpq(struct dma_device *dma) { return dma->max_pq & ~DMA_HAS_PQ_CONTINUE; }