diff options
author | Stephen Rothwell <sfr@canb.auug.org.au> | 2014-02-11 15:34:00 +1100 |
---|---|---|
committer | Stephen Rothwell <sfr@canb.auug.org.au> | 2014-02-11 15:34:00 +1100 |
commit | 8e248ac0b9d216b96707bc7bc195a2a82bea4602 (patch) | |
tree | 24bb0827ec2ec7c54d1a29facc043185c0d7f24b | |
parent | a2bc470e71d1868ac8895031ca34603b1faaa671 (diff) | |
parent | 674adcf8f23e4f4d82ae6a4c3df8a0b0d14f46e6 (diff) |
Merge branch 'akpm/master'
-rw-r--r-- | Documentation/ABI/testing/sysfs-class-bdi | 8 | ||||
-rw-r--r-- | arch/arm/mm/init.c | 6 | ||||
-rw-r--r-- | arch/arm/mm/mm.h | 2 | ||||
-rw-r--r-- | drivers/w1/w1_int.c | 5 | ||||
-rw-r--r-- | fs/udf/super.c | 2 | ||||
-rw-r--r-- | mm/backing-dev.c | 35 |
6 files changed, 50 insertions, 8 deletions
diff --git a/Documentation/ABI/testing/sysfs-class-bdi b/Documentation/ABI/testing/sysfs-class-bdi index d773d5697cf5..3187a18af6da 100644 --- a/Documentation/ABI/testing/sysfs-class-bdi +++ b/Documentation/ABI/testing/sysfs-class-bdi @@ -53,3 +53,11 @@ stable_pages_required (read-only) If set, the backing device requires that all pages comprising a write request must not be changed until writeout is complete. + +strictlimit (read-write) + + Forces per-BDI checks for the share of given device in the write-back + cache even before the global background dirty limit is reached. This + is useful in situations where the global limit is much higher than + affordable for given relatively slow (or untrusted) device. Turning + strictlimit on has no visible effect if max_ratio is equal to 100%. diff --git a/arch/arm/mm/init.c b/arch/arm/mm/init.c index 0d1c680eb9bd..42fc139bbed4 100644 --- a/arch/arm/mm/init.c +++ b/arch/arm/mm/init.c @@ -153,7 +153,6 @@ EXPORT_SYMBOL(arm_dma_zone_size); * allocations. This must be the smallest DMA mask in the system, * so a successful GFP_DMA allocation will always satisfy this. */ -phys_addr_t arm_dma_limit; unsigned long arm_dma_pfn_limit; static void __init arm_adjust_dma_zone(unsigned long *size, unsigned long *hole, @@ -172,6 +171,8 @@ static void __init arm_adjust_dma_zone(unsigned long *size, unsigned long *hole, void __init setup_dma_zone(const struct machine_desc *mdesc) { #ifdef CONFIG_ZONE_DMA + phys_addr_t arm_dma_limit; + if (mdesc->dma_zone_size) { arm_dma_zone_size = mdesc->dma_zone_size; arm_dma_limit = PHYS_OFFSET + arm_dma_zone_size - 1; @@ -327,7 +328,8 @@ void __init arm_memblock_init(struct meminfo *mi, * reserve memory for DMA contigouos allocations, * must come from DMA area inside low memory */ - dma_contiguous_reserve(min(arm_dma_limit, arm_lowmem_limit)); + dma_contiguous_reserve(min((phys_addr_t)arm_dma_pfn_limit << PAGE_SHIFT, + arm_lowmem_limit)); arm_memblock_steal_permitted = false; memblock_dump_all(); diff --git a/arch/arm/mm/mm.h b/arch/arm/mm/mm.h index d5a982d15a88..11f350997e54 100644 --- a/arch/arm/mm/mm.h +++ b/arch/arm/mm/mm.h @@ -80,10 +80,8 @@ extern __init void add_static_vm_early(struct static_vm *svm); #endif #ifdef CONFIG_ZONE_DMA -extern phys_addr_t arm_dma_limit; extern unsigned long arm_dma_pfn_limit; #else -#define arm_dma_limit ((phys_addr_t)~0) #define arm_dma_pfn_limit (~0ul >> PAGE_SHIFT) #endif diff --git a/drivers/w1/w1_int.c b/drivers/w1/w1_int.c index 9b084db739c7..3aaa15f6b7e9 100644 --- a/drivers/w1/w1_int.c +++ b/drivers/w1/w1_int.c @@ -92,9 +92,8 @@ static struct w1_master * w1_alloc_dev(u32 id, int slave_count, int slave_ttl, err = device_register(&dev->dev); if (err) { printk(KERN_ERR "Failed to register master device. err=%d\n", err); - memset(dev, 0, sizeof(struct w1_master)); - kfree(dev); - dev = NULL; + put_device(&dev->dev); + return NULL; } return dev; diff --git a/fs/udf/super.c b/fs/udf/super.c index 3306b9f69bed..6a1464999f02 100644 --- a/fs/udf/super.c +++ b/fs/udf/super.c @@ -175,7 +175,7 @@ static void init_once(void *foo) inode_init_once(&ei->vfs_inode); } -static int init_inodecache(void) +static int __init init_inodecache(void) { udf_inode_cachep = kmem_cache_create("udf_inode_cache", sizeof(struct udf_inode_info), diff --git a/mm/backing-dev.c b/mm/backing-dev.c index ce682f7a4f29..4ee1d64b52a2 100644 --- a/mm/backing-dev.c +++ b/mm/backing-dev.c @@ -234,11 +234,46 @@ static ssize_t stable_pages_required_show(struct device *dev, } static DEVICE_ATTR_RO(stable_pages_required); +static ssize_t strictlimit_store(struct device *dev, + struct device_attribute *attr, const char *buf, size_t count) +{ + struct backing_dev_info *bdi = dev_get_drvdata(dev); + unsigned int val; + ssize_t ret; + + ret = kstrtouint(buf, 10, &val); + if (ret < 0) + return ret; + + switch (val) { + case 0: + bdi->capabilities &= ~BDI_CAP_STRICTLIMIT; + break; + case 1: + bdi->capabilities |= BDI_CAP_STRICTLIMIT; + break; + default: + return -EINVAL; + } + + return count; +} +static ssize_t strictlimit_show(struct device *dev, + struct device_attribute *attr, char *page) +{ + struct backing_dev_info *bdi = dev_get_drvdata(dev); + + return snprintf(page, PAGE_SIZE-1, "%d\n", + !!(bdi->capabilities & BDI_CAP_STRICTLIMIT)); +} +static DEVICE_ATTR_RW(strictlimit); + static struct attribute *bdi_dev_attrs[] = { &dev_attr_read_ahead_kb.attr, &dev_attr_min_ratio.attr, &dev_attr_max_ratio.attr, &dev_attr_stable_pages_required.attr, + &dev_attr_strictlimit.attr, NULL, }; ATTRIBUTE_GROUPS(bdi_dev); |