Commit d2a04763 authored by Linus Torvalds's avatar Linus Torvalds

Merge branch 'akpm' (patches from Andrew Morton)

Merge misc fixes from Andrew Morton.

* emailed patches from Andrew Morton akpm@linux-foundation.org>:
  MAINTAINERS: change mailing list address for Altera UART drivers
  Makefile: fix build with make 3.80 again
  MAINTAINERS: update L: misuses
  Makefile: fix extra parenthesis typo when CC_STACKPROTECTOR_REGULAR is enabled
  ipc,mqueue: remove limits for the amount of system-wide queues
  memcg: change oom_info_lock to mutex
  mm, thp: fix infinite loop on memcg OOM
  drivers/fmc/fmc-write-eeprom.c: fix decimal permissions
  drivers/iommu/omap-iommu-debug.c: fix decimal permissions
  mm, hwpoison: release page on PageHWPoison() in __do_fault()
parents 6dba6ecb 61bd0943
...@@ -538,7 +538,7 @@ F: arch/alpha/ ...@@ -538,7 +538,7 @@ F: arch/alpha/
ALTERA UART/JTAG UART SERIAL DRIVERS ALTERA UART/JTAG UART SERIAL DRIVERS
M: Tobias Klauser <tklauser@distanz.ch> M: Tobias Klauser <tklauser@distanz.ch>
L: linux-serial@vger.kernel.org L: linux-serial@vger.kernel.org
L: nios2-dev@sopc.et.ntust.edu.tw (moderated for non-subscribers) L: nios2-dev@lists.rocketboards.org (moderated for non-subscribers)
S: Maintained S: Maintained
F: drivers/tty/serial/altera_uart.c F: drivers/tty/serial/altera_uart.c
F: drivers/tty/serial/altera_jtaguart.c F: drivers/tty/serial/altera_jtaguart.c
...@@ -2611,9 +2611,9 @@ DC395x SCSI driver ...@@ -2611,9 +2611,9 @@ DC395x SCSI driver
M: Oliver Neukum <oliver@neukum.org> M: Oliver Neukum <oliver@neukum.org>
M: Ali Akcaagac <aliakc@web.de> M: Ali Akcaagac <aliakc@web.de>
M: Jamie Lenehan <lenehan@twibble.org> M: Jamie Lenehan <lenehan@twibble.org>
W: http://twibble.org/dist/dc395x/
L: dc395x@twibble.org L: dc395x@twibble.org
L: http://lists.twibble.org/mailman/listinfo/dc395x/ W: http://twibble.org/dist/dc395x/
W: http://lists.twibble.org/mailman/listinfo/dc395x/
S: Maintained S: Maintained
F: Documentation/scsi/dc395x.txt F: Documentation/scsi/dc395x.txt
F: drivers/scsi/dc395x.* F: drivers/scsi/dc395x.*
...@@ -8443,8 +8443,8 @@ TARGET SUBSYSTEM ...@@ -8443,8 +8443,8 @@ TARGET SUBSYSTEM
M: Nicholas A. Bellinger <nab@linux-iscsi.org> M: Nicholas A. Bellinger <nab@linux-iscsi.org>
L: linux-scsi@vger.kernel.org L: linux-scsi@vger.kernel.org
L: target-devel@vger.kernel.org L: target-devel@vger.kernel.org
L: http://groups.google.com/group/linux-iscsi-target-dev
W: http://www.linux-iscsi.org W: http://www.linux-iscsi.org
W: http://groups.google.com/group/linux-iscsi-target-dev
T: git git://git.kernel.org/pub/scm/linux/kernel/git/nab/target-pending.git master T: git git://git.kernel.org/pub/scm/linux/kernel/git/nab/target-pending.git master
S: Supported S: Supported
F: drivers/target/ F: drivers/target/
......
...@@ -605,10 +605,11 @@ endif ...@@ -605,10 +605,11 @@ endif
ifdef CONFIG_CC_STACKPROTECTOR_REGULAR ifdef CONFIG_CC_STACKPROTECTOR_REGULAR
stackp-flag := -fstack-protector stackp-flag := -fstack-protector
ifeq ($(call cc-option, $(stackp-flag)),) ifeq ($(call cc-option, $(stackp-flag)),)
$(warning Cannot use CONFIG_CC_STACKPROTECTOR: \ $(warning Cannot use CONFIG_CC_STACKPROTECTOR_REGULAR: \
-fstack-protector not supported by compiler)) -fstack-protector not supported by compiler)
endif endif
else ifdef CONFIG_CC_STACKPROTECTOR_STRONG else
ifdef CONFIG_CC_STACKPROTECTOR_STRONG
stackp-flag := -fstack-protector-strong stackp-flag := -fstack-protector-strong
ifeq ($(call cc-option, $(stackp-flag)),) ifeq ($(call cc-option, $(stackp-flag)),)
$(warning Cannot use CONFIG_CC_STACKPROTECTOR_STRONG: \ $(warning Cannot use CONFIG_CC_STACKPROTECTOR_STRONG: \
...@@ -618,6 +619,7 @@ else ...@@ -618,6 +619,7 @@ else
# Force off for distro compilers that enable stack protector by default. # Force off for distro compilers that enable stack protector by default.
stackp-flag := $(call cc-option, -fno-stack-protector) stackp-flag := $(call cc-option, -fno-stack-protector)
endif endif
endif
KBUILD_CFLAGS += $(stackp-flag) KBUILD_CFLAGS += $(stackp-flag)
# This warning generated too much noise in a regular build. # This warning generated too much noise in a regular build.
......
...@@ -27,7 +27,7 @@ FMC_PARAM_BUSID(fwe_drv); ...@@ -27,7 +27,7 @@ FMC_PARAM_BUSID(fwe_drv);
/* The "file=" is like the generic "gateware=" used elsewhere */ /* The "file=" is like the generic "gateware=" used elsewhere */
static char *fwe_file[FMC_MAX_CARDS]; static char *fwe_file[FMC_MAX_CARDS];
static int fwe_file_n; static int fwe_file_n;
module_param_array_named(file, fwe_file, charp, &fwe_file_n, 444); module_param_array_named(file, fwe_file, charp, &fwe_file_n, 0444);
static int fwe_run_tlv(struct fmc_device *fmc, const struct firmware *fw, static int fwe_run_tlv(struct fmc_device *fmc, const struct firmware *fw,
int write) int write)
......
...@@ -354,8 +354,8 @@ DEBUG_FOPS(mem); ...@@ -354,8 +354,8 @@ DEBUG_FOPS(mem);
return -ENOMEM; \ return -ENOMEM; \
} }
#define DEBUG_ADD_FILE(name) __DEBUG_ADD_FILE(name, 600) #define DEBUG_ADD_FILE(name) __DEBUG_ADD_FILE(name, 0600)
#define DEBUG_ADD_FILE_RO(name) __DEBUG_ADD_FILE(name, 400) #define DEBUG_ADD_FILE_RO(name) __DEBUG_ADD_FILE(name, 0400)
static int iommu_debug_register(struct device *dev, void *data) static int iommu_debug_register(struct device *dev, void *data)
{ {
......
...@@ -118,9 +118,7 @@ extern int mq_init_ns(struct ipc_namespace *ns); ...@@ -118,9 +118,7 @@ extern int mq_init_ns(struct ipc_namespace *ns);
* the new maximum will handle anyone else. I may have to revisit this * the new maximum will handle anyone else. I may have to revisit this
* in the future. * in the future.
*/ */
#define MIN_QUEUESMAX 1
#define DFLT_QUEUESMAX 256 #define DFLT_QUEUESMAX 256
#define HARD_QUEUESMAX 1024
#define MIN_MSGMAX 1 #define MIN_MSGMAX 1
#define DFLT_MSG 10U #define DFLT_MSG 10U
#define DFLT_MSGMAX 10 #define DFLT_MSGMAX 10
......
...@@ -22,6 +22,16 @@ static void *get_mq(ctl_table *table) ...@@ -22,6 +22,16 @@ static void *get_mq(ctl_table *table)
return which; return which;
} }
static int proc_mq_dointvec(ctl_table *table, int write,
void __user *buffer, size_t *lenp, loff_t *ppos)
{
struct ctl_table mq_table;
memcpy(&mq_table, table, sizeof(mq_table));
mq_table.data = get_mq(table);
return proc_dointvec(&mq_table, write, buffer, lenp, ppos);
}
static int proc_mq_dointvec_minmax(ctl_table *table, int write, static int proc_mq_dointvec_minmax(ctl_table *table, int write,
void __user *buffer, size_t *lenp, loff_t *ppos) void __user *buffer, size_t *lenp, loff_t *ppos)
{ {
...@@ -33,12 +43,10 @@ static int proc_mq_dointvec_minmax(ctl_table *table, int write, ...@@ -33,12 +43,10 @@ static int proc_mq_dointvec_minmax(ctl_table *table, int write,
lenp, ppos); lenp, ppos);
} }
#else #else
#define proc_mq_dointvec NULL
#define proc_mq_dointvec_minmax NULL #define proc_mq_dointvec_minmax NULL
#endif #endif
static int msg_queues_limit_min = MIN_QUEUESMAX;
static int msg_queues_limit_max = HARD_QUEUESMAX;
static int msg_max_limit_min = MIN_MSGMAX; static int msg_max_limit_min = MIN_MSGMAX;
static int msg_max_limit_max = HARD_MSGMAX; static int msg_max_limit_max = HARD_MSGMAX;
...@@ -51,9 +59,7 @@ static ctl_table mq_sysctls[] = { ...@@ -51,9 +59,7 @@ static ctl_table mq_sysctls[] = {
.data = &init_ipc_ns.mq_queues_max, .data = &init_ipc_ns.mq_queues_max,
.maxlen = sizeof(int), .maxlen = sizeof(int),
.mode = 0644, .mode = 0644,
.proc_handler = proc_mq_dointvec_minmax, .proc_handler = proc_mq_dointvec,
.extra1 = &msg_queues_limit_min,
.extra2 = &msg_queues_limit_max,
}, },
{ {
.procname = "msg_max", .procname = "msg_max",
......
...@@ -433,9 +433,9 @@ static int mqueue_create(struct inode *dir, struct dentry *dentry, ...@@ -433,9 +433,9 @@ static int mqueue_create(struct inode *dir, struct dentry *dentry,
error = -EACCES; error = -EACCES;
goto out_unlock; goto out_unlock;
} }
if (ipc_ns->mq_queues_count >= HARD_QUEUESMAX ||
(ipc_ns->mq_queues_count >= ipc_ns->mq_queues_max && if (ipc_ns->mq_queues_count >= ipc_ns->mq_queues_max &&
!capable(CAP_SYS_RESOURCE))) { !capable(CAP_SYS_RESOURCE)) {
error = -ENOSPC; error = -ENOSPC;
goto out_unlock; goto out_unlock;
} }
......
...@@ -1166,8 +1166,10 @@ int do_huge_pmd_wp_page(struct mm_struct *mm, struct vm_area_struct *vma, ...@@ -1166,8 +1166,10 @@ int do_huge_pmd_wp_page(struct mm_struct *mm, struct vm_area_struct *vma,
} else { } else {
ret = do_huge_pmd_wp_page_fallback(mm, vma, address, ret = do_huge_pmd_wp_page_fallback(mm, vma, address,
pmd, orig_pmd, page, haddr); pmd, orig_pmd, page, haddr);
if (ret & VM_FAULT_OOM) if (ret & VM_FAULT_OOM) {
split_huge_page(page); split_huge_page(page);
ret |= VM_FAULT_FALLBACK;
}
put_page(page); put_page(page);
} }
count_vm_event(THP_FAULT_FALLBACK); count_vm_event(THP_FAULT_FALLBACK);
...@@ -1179,9 +1181,10 @@ int do_huge_pmd_wp_page(struct mm_struct *mm, struct vm_area_struct *vma, ...@@ -1179,9 +1181,10 @@ int do_huge_pmd_wp_page(struct mm_struct *mm, struct vm_area_struct *vma,
if (page) { if (page) {
split_huge_page(page); split_huge_page(page);
put_page(page); put_page(page);
} } else
split_huge_page_pmd(vma, address, pmd);
ret |= VM_FAULT_FALLBACK;
count_vm_event(THP_FAULT_FALLBACK); count_vm_event(THP_FAULT_FALLBACK);
ret |= VM_FAULT_OOM;
goto out; goto out;
} }
......
...@@ -1687,7 +1687,7 @@ void mem_cgroup_print_oom_info(struct mem_cgroup *memcg, struct task_struct *p) ...@@ -1687,7 +1687,7 @@ void mem_cgroup_print_oom_info(struct mem_cgroup *memcg, struct task_struct *p)
* protects memcg_name and makes sure that parallel ooms do not * protects memcg_name and makes sure that parallel ooms do not
* interleave * interleave
*/ */
static DEFINE_SPINLOCK(oom_info_lock); static DEFINE_MUTEX(oom_info_lock);
struct cgroup *task_cgrp; struct cgroup *task_cgrp;
struct cgroup *mem_cgrp; struct cgroup *mem_cgrp;
static char memcg_name[PATH_MAX]; static char memcg_name[PATH_MAX];
...@@ -1698,7 +1698,7 @@ void mem_cgroup_print_oom_info(struct mem_cgroup *memcg, struct task_struct *p) ...@@ -1698,7 +1698,7 @@ void mem_cgroup_print_oom_info(struct mem_cgroup *memcg, struct task_struct *p)
if (!p) if (!p)
return; return;
spin_lock(&oom_info_lock); mutex_lock(&oom_info_lock);
rcu_read_lock(); rcu_read_lock();
mem_cgrp = memcg->css.cgroup; mem_cgrp = memcg->css.cgroup;
...@@ -1767,7 +1767,7 @@ void mem_cgroup_print_oom_info(struct mem_cgroup *memcg, struct task_struct *p) ...@@ -1767,7 +1767,7 @@ void mem_cgroup_print_oom_info(struct mem_cgroup *memcg, struct task_struct *p)
pr_cont("\n"); pr_cont("\n");
} }
spin_unlock(&oom_info_lock); mutex_unlock(&oom_info_lock);
} }
/* /*
......
...@@ -3348,6 +3348,7 @@ static int __do_fault(struct mm_struct *mm, struct vm_area_struct *vma, ...@@ -3348,6 +3348,7 @@ static int __do_fault(struct mm_struct *mm, struct vm_area_struct *vma,
if (ret & VM_FAULT_LOCKED) if (ret & VM_FAULT_LOCKED)
unlock_page(vmf.page); unlock_page(vmf.page);
ret = VM_FAULT_HWPOISON; ret = VM_FAULT_HWPOISON;
page_cache_release(vmf.page);
goto uncharge_out; goto uncharge_out;
} }
...@@ -3703,7 +3704,6 @@ static int __handle_mm_fault(struct mm_struct *mm, struct vm_area_struct *vma, ...@@ -3703,7 +3704,6 @@ static int __handle_mm_fault(struct mm_struct *mm, struct vm_area_struct *vma,
if (unlikely(is_vm_hugetlb_page(vma))) if (unlikely(is_vm_hugetlb_page(vma)))
return hugetlb_fault(mm, vma, address, flags); return hugetlb_fault(mm, vma, address, flags);
retry:
pgd = pgd_offset(mm, address); pgd = pgd_offset(mm, address);
pud = pud_alloc(mm, pgd, address); pud = pud_alloc(mm, pgd, address);
if (!pud) if (!pud)
...@@ -3741,20 +3741,13 @@ static int __handle_mm_fault(struct mm_struct *mm, struct vm_area_struct *vma, ...@@ -3741,20 +3741,13 @@ static int __handle_mm_fault(struct mm_struct *mm, struct vm_area_struct *vma,
if (dirty && !pmd_write(orig_pmd)) { if (dirty && !pmd_write(orig_pmd)) {
ret = do_huge_pmd_wp_page(mm, vma, address, pmd, ret = do_huge_pmd_wp_page(mm, vma, address, pmd,
orig_pmd); orig_pmd);
/* if (!(ret & VM_FAULT_FALLBACK))
* If COW results in an oom, the huge pmd will return ret;
* have been split, so retry the fault on the
* pte for a smaller charge.
*/
if (unlikely(ret & VM_FAULT_OOM))
goto retry;
return ret;
} else { } else {
huge_pmd_set_accessed(mm, vma, address, pmd, huge_pmd_set_accessed(mm, vma, address, pmd,
orig_pmd, dirty); orig_pmd, dirty);
return 0;
} }
return 0;
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment