Commit e9738946 authored by Linus Torvalds's avatar Linus Torvalds

Merge branch 'akpm' (patches from Andrew)

Merge misc fixes from Andrew Morton:
 "13 fixes"

* emailed patches from Andrew Morton <akpm@linux-foundation.org>:
  mm: add missing __PAGETABLE_{PUD,PMD}_FOLDED defines
  mm: page_alloc: revert inadvertent !__GFP_FS retry behavior change
  kernel/sys.c: fix UNAME26 for 4.0
  mm: memcontrol: use "max" instead of "infinity" in control knobs
  zram: use proper type to update max_used_pages
  drivers/rtc/rtc-ds1685.c: fix conditional in ds1685_rtc_sysfs_time_regs_{show,store}
  nilfs2: fix potential memory overrun on inode
  scripts/gdb: add empty package initialization script
  rtc: ds1685: remove superfluous checks for out-of-range u8 values
  rtc: ds1685: fix ds1685_rtc_alarm_irq_enable build error
  memcg: fix low limit calculation
  mm/nommu: fix memory leak
  ocfs2: update web page + git tree in documentation
parents 895c8b7b c07af4f1
...@@ -404,8 +404,8 @@ supported and the interface files "release_agent" and ...@@ -404,8 +404,8 @@ supported and the interface files "release_agent" and
be understood as an underflow into the highest possible value, -2 or be understood as an underflow into the highest possible value, -2 or
-10M etc. do not work, so it's not consistent. -10M etc. do not work, so it's not consistent.
memory.low, memory.high, and memory.max will use the string memory.low, memory.high, and memory.max will use the string "max" to
"infinity" to indicate and set the highest possible value. indicate and set the highest possible value.
5. Planned Changes 5. Planned Changes
......
...@@ -5,8 +5,8 @@ system. ...@@ -5,8 +5,8 @@ system.
dlmfs is built with OCFS2 as it requires most of its infrastructure. dlmfs is built with OCFS2 as it requires most of its infrastructure.
Project web page: http://oss.oracle.com/projects/ocfs2 Project web page: http://ocfs2.wiki.kernel.org
Tools web page: http://oss.oracle.com/projects/ocfs2-tools Tools web page: https://github.com/markfasheh/ocfs2-tools
OCFS2 mailing lists: http://oss.oracle.com/projects/ocfs2/mailman/ OCFS2 mailing lists: http://oss.oracle.com/projects/ocfs2/mailman/
All code copyright 2005 Oracle except when otherwise noted. All code copyright 2005 Oracle except when otherwise noted.
......
...@@ -8,8 +8,8 @@ also make it attractive for non-clustered use. ...@@ -8,8 +8,8 @@ also make it attractive for non-clustered use.
You'll want to install the ocfs2-tools package in order to at least You'll want to install the ocfs2-tools package in order to at least
get "mount.ocfs2" and "ocfs2_hb_ctl". get "mount.ocfs2" and "ocfs2_hb_ctl".
Project web page: http://oss.oracle.com/projects/ocfs2 Project web page: http://ocfs2.wiki.kernel.org
Tools web page: http://oss.oracle.com/projects/ocfs2-tools Tools git tree: https://github.com/markfasheh/ocfs2-tools
OCFS2 mailing lists: http://oss.oracle.com/projects/ocfs2/mailman/ OCFS2 mailing lists: http://oss.oracle.com/projects/ocfs2/mailman/
All code copyright 2005 Oracle except when otherwise noted. All code copyright 2005 Oracle except when otherwise noted.
......
...@@ -7213,8 +7213,7 @@ ORACLE CLUSTER FILESYSTEM 2 (OCFS2) ...@@ -7213,8 +7213,7 @@ ORACLE CLUSTER FILESYSTEM 2 (OCFS2)
M: Mark Fasheh <mfasheh@suse.com> M: Mark Fasheh <mfasheh@suse.com>
M: Joel Becker <jlbec@evilplan.org> M: Joel Becker <jlbec@evilplan.org>
L: ocfs2-devel@oss.oracle.com (moderated for non-subscribers) L: ocfs2-devel@oss.oracle.com (moderated for non-subscribers)
W: http://oss.oracle.com/projects/ocfs2/ W: http://ocfs2.wiki.kernel.org
T: git git://git.kernel.org/pub/scm/linux/kernel/git/jlbec/ocfs2.git
S: Supported S: Supported
F: Documentation/filesystems/ocfs2.txt F: Documentation/filesystems/ocfs2.txt
F: Documentation/filesystems/dlmfs.txt F: Documentation/filesystems/dlmfs.txt
......
...@@ -123,12 +123,14 @@ extern unsigned long empty_zero_page; ...@@ -123,12 +123,14 @@ extern unsigned long empty_zero_page;
#define PGDIR_MASK (~(PGDIR_SIZE - 1)) #define PGDIR_MASK (~(PGDIR_SIZE - 1))
#define PTRS_PER_PGD 64 #define PTRS_PER_PGD 64
#define __PAGETABLE_PUD_FOLDED
#define PUD_SHIFT 26 #define PUD_SHIFT 26
#define PTRS_PER_PUD 1 #define PTRS_PER_PUD 1
#define PUD_SIZE (1UL << PUD_SHIFT) #define PUD_SIZE (1UL << PUD_SHIFT)
#define PUD_MASK (~(PUD_SIZE - 1)) #define PUD_MASK (~(PUD_SIZE - 1))
#define PUE_SIZE 256 #define PUE_SIZE 256
#define __PAGETABLE_PMD_FOLDED
#define PMD_SHIFT 26 #define PMD_SHIFT 26
#define PMD_SIZE (1UL << PMD_SHIFT) #define PMD_SIZE (1UL << PMD_SHIFT)
#define PMD_MASK (~(PMD_SIZE - 1)) #define PMD_MASK (~(PMD_SIZE - 1))
......
...@@ -13,6 +13,7 @@ ...@@ -13,6 +13,7 @@
* the M32R is two-level, so we don't really have any * the M32R is two-level, so we don't really have any
* PMD directory physically. * PMD directory physically.
*/ */
#define __PAGETABLE_PMD_FOLDED
#define PMD_SHIFT 22 #define PMD_SHIFT 22
#define PTRS_PER_PMD 1 #define PTRS_PER_PMD 1
......
...@@ -54,10 +54,12 @@ ...@@ -54,10 +54,12 @@
*/ */
#ifdef CONFIG_SUN3 #ifdef CONFIG_SUN3
#define PTRS_PER_PTE 16 #define PTRS_PER_PTE 16
#define __PAGETABLE_PMD_FOLDED
#define PTRS_PER_PMD 1 #define PTRS_PER_PMD 1
#define PTRS_PER_PGD 2048 #define PTRS_PER_PGD 2048
#elif defined(CONFIG_COLDFIRE) #elif defined(CONFIG_COLDFIRE)
#define PTRS_PER_PTE 512 #define PTRS_PER_PTE 512
#define __PAGETABLE_PMD_FOLDED
#define PTRS_PER_PMD 1 #define PTRS_PER_PMD 1
#define PTRS_PER_PGD 1024 #define PTRS_PER_PGD 1024
#else #else
......
...@@ -56,7 +56,9 @@ extern void paging_init(void); ...@@ -56,7 +56,9 @@ extern void paging_init(void);
#define PGDIR_SHIFT 22 #define PGDIR_SHIFT 22
#define PTRS_PER_PGD 1024 #define PTRS_PER_PGD 1024
#define PTRS_PER_PUD 1 /* we don't really have any PUD physically */ #define PTRS_PER_PUD 1 /* we don't really have any PUD physically */
#define __PAGETABLE_PUD_FOLDED
#define PTRS_PER_PMD 1 /* we don't really have any PMD physically */ #define PTRS_PER_PMD 1 /* we don't really have any PMD physically */
#define __PAGETABLE_PMD_FOLDED
#define PTRS_PER_PTE 1024 #define PTRS_PER_PTE 1024
#define PGD_SIZE PAGE_SIZE #define PGD_SIZE PAGE_SIZE
......
...@@ -96,6 +96,7 @@ extern void purge_tlb_entries(struct mm_struct *, unsigned long); ...@@ -96,6 +96,7 @@ extern void purge_tlb_entries(struct mm_struct *, unsigned long);
#if PT_NLEVELS == 3 #if PT_NLEVELS == 3
#define BITS_PER_PMD (PAGE_SHIFT + PMD_ORDER - BITS_PER_PMD_ENTRY) #define BITS_PER_PMD (PAGE_SHIFT + PMD_ORDER - BITS_PER_PMD_ENTRY)
#else #else
#define __PAGETABLE_PMD_FOLDED
#define BITS_PER_PMD 0 #define BITS_PER_PMD 0
#endif #endif
#define PTRS_PER_PMD (1UL << BITS_PER_PMD) #define PTRS_PER_PMD (1UL << BITS_PER_PMD)
......
...@@ -91,7 +91,9 @@ extern unsigned long zero_page_mask; ...@@ -91,7 +91,9 @@ extern unsigned long zero_page_mask;
*/ */
#define PTRS_PER_PTE 256 #define PTRS_PER_PTE 256
#ifndef CONFIG_64BIT #ifndef CONFIG_64BIT
#define __PAGETABLE_PUD_FOLDED
#define PTRS_PER_PMD 1 #define PTRS_PER_PMD 1
#define __PAGETABLE_PMD_FOLDED
#define PTRS_PER_PUD 1 #define PTRS_PER_PUD 1
#else /* CONFIG_64BIT */ #else /* CONFIG_64BIT */
#define PTRS_PER_PMD 2048 #define PTRS_PER_PMD 2048
......
...@@ -528,7 +528,7 @@ static int zram_bvec_read(struct zram *zram, struct bio_vec *bvec, ...@@ -528,7 +528,7 @@ static int zram_bvec_read(struct zram *zram, struct bio_vec *bvec,
static inline void update_used_max(struct zram *zram, static inline void update_used_max(struct zram *zram,
const unsigned long pages) const unsigned long pages)
{ {
int old_max, cur_max; unsigned long old_max, cur_max;
old_max = atomic_long_read(&zram->stats.max_used_pages); old_max = atomic_long_read(&zram->stats.max_used_pages);
......
...@@ -399,21 +399,21 @@ ds1685_rtc_read_alarm(struct device *dev, struct rtc_wkalrm *alrm) ...@@ -399,21 +399,21 @@ ds1685_rtc_read_alarm(struct device *dev, struct rtc_wkalrm *alrm)
* of this RTC chip. We check for it anyways in case support is * of this RTC chip. We check for it anyways in case support is
* added in the future. * added in the future.
*/ */
if (unlikely((seconds >= 0xc0) && (seconds <= 0xff))) if (unlikely(seconds >= 0xc0))
alrm->time.tm_sec = -1; alrm->time.tm_sec = -1;
else else
alrm->time.tm_sec = ds1685_rtc_bcd2bin(rtc, seconds, alrm->time.tm_sec = ds1685_rtc_bcd2bin(rtc, seconds,
RTC_SECS_BCD_MASK, RTC_SECS_BCD_MASK,
RTC_SECS_BIN_MASK); RTC_SECS_BIN_MASK);
if (unlikely((minutes >= 0xc0) && (minutes <= 0xff))) if (unlikely(minutes >= 0xc0))
alrm->time.tm_min = -1; alrm->time.tm_min = -1;
else else
alrm->time.tm_min = ds1685_rtc_bcd2bin(rtc, minutes, alrm->time.tm_min = ds1685_rtc_bcd2bin(rtc, minutes,
RTC_MINS_BCD_MASK, RTC_MINS_BCD_MASK,
RTC_MINS_BIN_MASK); RTC_MINS_BIN_MASK);
if (unlikely((hours >= 0xc0) && (hours <= 0xff))) if (unlikely(hours >= 0xc0))
alrm->time.tm_hour = -1; alrm->time.tm_hour = -1;
else else
alrm->time.tm_hour = ds1685_rtc_bcd2bin(rtc, hours, alrm->time.tm_hour = ds1685_rtc_bcd2bin(rtc, hours,
...@@ -472,13 +472,13 @@ ds1685_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *alrm) ...@@ -472,13 +472,13 @@ ds1685_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *alrm)
* field, and we only support four fields. We put the support * field, and we only support four fields. We put the support
* here anyways for the future. * here anyways for the future.
*/ */
if (unlikely((seconds >= 0xc0) && (seconds <= 0xff))) if (unlikely(seconds >= 0xc0))
seconds = 0xff; seconds = 0xff;
if (unlikely((minutes >= 0xc0) && (minutes <= 0xff))) if (unlikely(minutes >= 0xc0))
minutes = 0xff; minutes = 0xff;
if (unlikely((hours >= 0xc0) && (hours <= 0xff))) if (unlikely(hours >= 0xc0))
hours = 0xff; hours = 0xff;
alrm->time.tm_mon = -1; alrm->time.tm_mon = -1;
...@@ -528,7 +528,6 @@ ds1685_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *alrm) ...@@ -528,7 +528,6 @@ ds1685_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *alrm)
/* ----------------------------------------------------------------------- */ /* ----------------------------------------------------------------------- */
/* /dev/rtcX Interface functions */ /* /dev/rtcX Interface functions */
#ifdef CONFIG_RTC_INTF_DEV
/** /**
* ds1685_rtc_alarm_irq_enable - replaces ioctl() RTC_AIE on/off. * ds1685_rtc_alarm_irq_enable - replaces ioctl() RTC_AIE on/off.
* @dev: pointer to device structure. * @dev: pointer to device structure.
...@@ -557,7 +556,6 @@ ds1685_rtc_alarm_irq_enable(struct device *dev, unsigned int enabled) ...@@ -557,7 +556,6 @@ ds1685_rtc_alarm_irq_enable(struct device *dev, unsigned int enabled)
return 0; return 0;
} }
#endif
/* ----------------------------------------------------------------------- */ /* ----------------------------------------------------------------------- */
...@@ -1612,7 +1610,7 @@ ds1685_rtc_sysfs_time_regs_show(struct device *dev, ...@@ -1612,7 +1610,7 @@ ds1685_rtc_sysfs_time_regs_show(struct device *dev,
ds1685_rtc_sysfs_time_regs_lookup(attr->attr.name, false); ds1685_rtc_sysfs_time_regs_lookup(attr->attr.name, false);
/* Make sure we actually matched something. */ /* Make sure we actually matched something. */
if (!bcd_reg_info && !bin_reg_info) if (!bcd_reg_info || !bin_reg_info)
return -EINVAL; return -EINVAL;
/* bcd_reg_info->reg == bin_reg_info->reg. */ /* bcd_reg_info->reg == bin_reg_info->reg. */
...@@ -1650,7 +1648,7 @@ ds1685_rtc_sysfs_time_regs_store(struct device *dev, ...@@ -1650,7 +1648,7 @@ ds1685_rtc_sysfs_time_regs_store(struct device *dev,
return -EINVAL; return -EINVAL;
/* Make sure we actually matched something. */ /* Make sure we actually matched something. */
if (!bcd_reg_info && !bin_reg_info) if (!bcd_reg_info || !bin_reg_info)
return -EINVAL; return -EINVAL;
/* Check for a valid range. */ /* Check for a valid range. */
......
...@@ -31,6 +31,8 @@ ...@@ -31,6 +31,8 @@
#include "alloc.h" #include "alloc.h"
#include "dat.h" #include "dat.h"
static void __nilfs_btree_init(struct nilfs_bmap *bmap);
static struct nilfs_btree_path *nilfs_btree_alloc_path(void) static struct nilfs_btree_path *nilfs_btree_alloc_path(void)
{ {
struct nilfs_btree_path *path; struct nilfs_btree_path *path;
...@@ -368,6 +370,34 @@ static int nilfs_btree_node_broken(const struct nilfs_btree_node *node, ...@@ -368,6 +370,34 @@ static int nilfs_btree_node_broken(const struct nilfs_btree_node *node,
return ret; return ret;
} }
/**
* nilfs_btree_root_broken - verify consistency of btree root node
* @node: btree root node to be examined
* @ino: inode number
*
* Return Value: If node is broken, 1 is returned. Otherwise, 0 is returned.
*/
static int nilfs_btree_root_broken(const struct nilfs_btree_node *node,
unsigned long ino)
{
int level, flags, nchildren;
int ret = 0;
level = nilfs_btree_node_get_level(node);
flags = nilfs_btree_node_get_flags(node);
nchildren = nilfs_btree_node_get_nchildren(node);
if (unlikely(level < NILFS_BTREE_LEVEL_NODE_MIN ||
level > NILFS_BTREE_LEVEL_MAX ||
nchildren < 0 ||
nchildren > NILFS_BTREE_ROOT_NCHILDREN_MAX)) {
pr_crit("NILFS: bad btree root (inode number=%lu): level = %d, flags = 0x%x, nchildren = %d\n",
ino, level, flags, nchildren);
ret = 1;
}
return ret;
}
int nilfs_btree_broken_node_block(struct buffer_head *bh) int nilfs_btree_broken_node_block(struct buffer_head *bh)
{ {
int ret; int ret;
...@@ -1713,7 +1743,7 @@ nilfs_btree_commit_convert_and_insert(struct nilfs_bmap *btree, ...@@ -1713,7 +1743,7 @@ nilfs_btree_commit_convert_and_insert(struct nilfs_bmap *btree,
/* convert and insert */ /* convert and insert */
dat = NILFS_BMAP_USE_VBN(btree) ? nilfs_bmap_get_dat(btree) : NULL; dat = NILFS_BMAP_USE_VBN(btree) ? nilfs_bmap_get_dat(btree) : NULL;
nilfs_btree_init(btree); __nilfs_btree_init(btree);
if (nreq != NULL) { if (nreq != NULL) {
nilfs_bmap_commit_alloc_ptr(btree, dreq, dat); nilfs_bmap_commit_alloc_ptr(btree, dreq, dat);
nilfs_bmap_commit_alloc_ptr(btree, nreq, dat); nilfs_bmap_commit_alloc_ptr(btree, nreq, dat);
...@@ -2294,12 +2324,23 @@ static const struct nilfs_bmap_operations nilfs_btree_ops_gc = { ...@@ -2294,12 +2324,23 @@ static const struct nilfs_bmap_operations nilfs_btree_ops_gc = {
.bop_gather_data = NULL, .bop_gather_data = NULL,
}; };
int nilfs_btree_init(struct nilfs_bmap *bmap) static void __nilfs_btree_init(struct nilfs_bmap *bmap)
{ {
bmap->b_ops = &nilfs_btree_ops; bmap->b_ops = &nilfs_btree_ops;
bmap->b_nchildren_per_block = bmap->b_nchildren_per_block =
NILFS_BTREE_NODE_NCHILDREN_MAX(nilfs_btree_node_size(bmap)); NILFS_BTREE_NODE_NCHILDREN_MAX(nilfs_btree_node_size(bmap));
return 0; }
int nilfs_btree_init(struct nilfs_bmap *bmap)
{
int ret = 0;
__nilfs_btree_init(bmap);
if (nilfs_btree_root_broken(nilfs_btree_get_root(bmap),
bmap->b_inode->i_ino))
ret = -EIO;
return ret;
} }
void nilfs_btree_init_gc(struct nilfs_bmap *bmap) void nilfs_btree_init_gc(struct nilfs_bmap *bmap)
......
...@@ -1108,6 +1108,7 @@ DECLARE_RWSEM(uts_sem); ...@@ -1108,6 +1108,7 @@ DECLARE_RWSEM(uts_sem);
/* /*
* Work around broken programs that cannot handle "Linux 3.0". * Work around broken programs that cannot handle "Linux 3.0".
* Instead we map 3.x to 2.6.40+x, so e.g. 3.0 would be 2.6.40 * Instead we map 3.x to 2.6.40+x, so e.g. 3.0 would be 2.6.40
* And we map 4.x to 2.6.60+x, so 4.0 would be 2.6.60.
*/ */
static int override_release(char __user *release, size_t len) static int override_release(char __user *release, size_t len)
{ {
...@@ -1127,7 +1128,7 @@ static int override_release(char __user *release, size_t len) ...@@ -1127,7 +1128,7 @@ static int override_release(char __user *release, size_t len)
break; break;
rest++; rest++;
} }
v = ((LINUX_VERSION_CODE >> 8) & 0xff) + 40; v = ((LINUX_VERSION_CODE >> 8) & 0xff) + 60;
copy = clamp_t(size_t, len, 1, sizeof(buf)); copy = clamp_t(size_t, len, 1, sizeof(buf));
copy = scnprintf(buf, copy, "2.6.%u%s", v, rest); copy = scnprintf(buf, copy, "2.6.%u%s", v, rest);
ret = copy_to_user(release, buf, copy + 1); ret = copy_to_user(release, buf, copy + 1);
......
...@@ -5247,7 +5247,7 @@ static int memory_low_show(struct seq_file *m, void *v) ...@@ -5247,7 +5247,7 @@ static int memory_low_show(struct seq_file *m, void *v)
unsigned long low = ACCESS_ONCE(memcg->low); unsigned long low = ACCESS_ONCE(memcg->low);
if (low == PAGE_COUNTER_MAX) if (low == PAGE_COUNTER_MAX)
seq_puts(m, "infinity\n"); seq_puts(m, "max\n");
else else
seq_printf(m, "%llu\n", (u64)low * PAGE_SIZE); seq_printf(m, "%llu\n", (u64)low * PAGE_SIZE);
...@@ -5262,7 +5262,7 @@ static ssize_t memory_low_write(struct kernfs_open_file *of, ...@@ -5262,7 +5262,7 @@ static ssize_t memory_low_write(struct kernfs_open_file *of,
int err; int err;
buf = strstrip(buf); buf = strstrip(buf);
err = page_counter_memparse(buf, "infinity", &low); err = page_counter_memparse(buf, "max", &low);
if (err) if (err)
return err; return err;
...@@ -5277,7 +5277,7 @@ static int memory_high_show(struct seq_file *m, void *v) ...@@ -5277,7 +5277,7 @@ static int memory_high_show(struct seq_file *m, void *v)
unsigned long high = ACCESS_ONCE(memcg->high); unsigned long high = ACCESS_ONCE(memcg->high);
if (high == PAGE_COUNTER_MAX) if (high == PAGE_COUNTER_MAX)
seq_puts(m, "infinity\n"); seq_puts(m, "max\n");
else else
seq_printf(m, "%llu\n", (u64)high * PAGE_SIZE); seq_printf(m, "%llu\n", (u64)high * PAGE_SIZE);
...@@ -5292,7 +5292,7 @@ static ssize_t memory_high_write(struct kernfs_open_file *of, ...@@ -5292,7 +5292,7 @@ static ssize_t memory_high_write(struct kernfs_open_file *of,
int err; int err;
buf = strstrip(buf); buf = strstrip(buf);
err = page_counter_memparse(buf, "infinity", &high); err = page_counter_memparse(buf, "max", &high);
if (err) if (err)
return err; return err;
...@@ -5307,7 +5307,7 @@ static int memory_max_show(struct seq_file *m, void *v) ...@@ -5307,7 +5307,7 @@ static int memory_max_show(struct seq_file *m, void *v)
unsigned long max = ACCESS_ONCE(memcg->memory.limit); unsigned long max = ACCESS_ONCE(memcg->memory.limit);
if (max == PAGE_COUNTER_MAX) if (max == PAGE_COUNTER_MAX)
seq_puts(m, "infinity\n"); seq_puts(m, "max\n");
else else
seq_printf(m, "%llu\n", (u64)max * PAGE_SIZE); seq_printf(m, "%llu\n", (u64)max * PAGE_SIZE);
...@@ -5322,7 +5322,7 @@ static ssize_t memory_max_write(struct kernfs_open_file *of, ...@@ -5322,7 +5322,7 @@ static ssize_t memory_max_write(struct kernfs_open_file *of,
int err; int err;
buf = strstrip(buf); buf = strstrip(buf);
err = page_counter_memparse(buf, "infinity", &max); err = page_counter_memparse(buf, "max", &max);
if (err) if (err)
return err; return err;
...@@ -5426,7 +5426,7 @@ bool mem_cgroup_low(struct mem_cgroup *root, struct mem_cgroup *memcg) ...@@ -5426,7 +5426,7 @@ bool mem_cgroup_low(struct mem_cgroup *root, struct mem_cgroup *memcg)
if (memcg == root_mem_cgroup) if (memcg == root_mem_cgroup)
return false; return false;
if (page_counter_read(&memcg->memory) > memcg->low) if (page_counter_read(&memcg->memory) >= memcg->low)
return false; return false;
while (memcg != root) { while (memcg != root) {
...@@ -5435,7 +5435,7 @@ bool mem_cgroup_low(struct mem_cgroup *root, struct mem_cgroup *memcg) ...@@ -5435,7 +5435,7 @@ bool mem_cgroup_low(struct mem_cgroup *root, struct mem_cgroup *memcg)
if (memcg == root_mem_cgroup) if (memcg == root_mem_cgroup)
break; break;
if (page_counter_read(&memcg->memory) > memcg->low) if (page_counter_read(&memcg->memory) >= memcg->low)
return false; return false;
} }
return true; return true;
......
...@@ -1213,11 +1213,9 @@ static int do_mmap_private(struct vm_area_struct *vma, ...@@ -1213,11 +1213,9 @@ static int do_mmap_private(struct vm_area_struct *vma,
if (sysctl_nr_trim_pages && total - point >= sysctl_nr_trim_pages) { if (sysctl_nr_trim_pages && total - point >= sysctl_nr_trim_pages) {
total = point; total = point;
kdebug("try to alloc exact %lu pages", total); kdebug("try to alloc exact %lu pages", total);
base = alloc_pages_exact(len, GFP_KERNEL);
} else {
base = (void *)__get_free_pages(GFP_KERNEL, order);
} }
base = alloc_pages_exact(total << PAGE_SHIFT, GFP_KERNEL);
if (!base) if (!base)
goto enomem; goto enomem;
......
...@@ -2353,8 +2353,15 @@ __alloc_pages_may_oom(gfp_t gfp_mask, unsigned int order, ...@@ -2353,8 +2353,15 @@ __alloc_pages_may_oom(gfp_t gfp_mask, unsigned int order,
if (ac->high_zoneidx < ZONE_NORMAL) if (ac->high_zoneidx < ZONE_NORMAL)
goto out; goto out;
/* The OOM killer does not compensate for light reclaim */ /* The OOM killer does not compensate for light reclaim */
if (!(gfp_mask & __GFP_FS)) if (!(gfp_mask & __GFP_FS)) {
/*
* XXX: Page reclaim didn't yield anything,
* and the OOM killer can't be invoked, but
* keep looping as per should_alloc_retry().
*/
*did_some_progress = 1;
goto out; goto out;
}
/* /*
* GFP_THISNODE contains __GFP_NORETRY and we never hit this. * GFP_THISNODE contains __GFP_NORETRY and we never hit this.
* Sanity check for bare calls of __GFP_THISNODE, not real OOM. * Sanity check for bare calls of __GFP_THISNODE, not real OOM.
......
# nothing to do for the initialization of this package
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