Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 230822
b: refs/heads/master
c: 08d4a24
h: refs/heads/master
v: v3
  • Loading branch information
Michal Hocko authored and Linus Torvalds committed Jan 14, 2011
1 parent 39f500f commit 482ef66
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 7 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: cb9ef8d5e394f70db64bda79c20d3569a20d2574
refs/heads/master: 08d4a24659f1284f33e574211435aa12ce968477
18 changes: 12 additions & 6 deletions trunk/mm/hugetlb.c
Original file line number Diff line number Diff line change
Expand Up @@ -1859,13 +1859,16 @@ static int hugetlb_sysctl_handler_common(bool obey_mempolicy,
{
struct hstate *h = &default_hstate;
unsigned long tmp;
int ret;

if (!write)
tmp = h->max_huge_pages;

table->data = &tmp;
table->maxlen = sizeof(unsigned long);
proc_doulongvec_minmax(table, write, buffer, length, ppos);
ret = proc_doulongvec_minmax(table, write, buffer, length, ppos);
if (ret)
goto out;

if (write) {
NODEMASK_ALLOC(nodemask_t, nodes_allowed,
Expand All @@ -1880,8 +1883,8 @@ static int hugetlb_sysctl_handler_common(bool obey_mempolicy,
if (nodes_allowed != &node_states[N_HIGH_MEMORY])
NODEMASK_FREE(nodes_allowed);
}

return 0;
out:
return ret;
}

int hugetlb_sysctl_handler(struct ctl_table *table, int write,
Expand Down Expand Up @@ -1919,21 +1922,24 @@ int hugetlb_overcommit_handler(struct ctl_table *table, int write,
{
struct hstate *h = &default_hstate;
unsigned long tmp;
int ret;

if (!write)
tmp = h->nr_overcommit_huge_pages;

table->data = &tmp;
table->maxlen = sizeof(unsigned long);
proc_doulongvec_minmax(table, write, buffer, length, ppos);
ret = proc_doulongvec_minmax(table, write, buffer, length, ppos);
if (ret)
goto out;

if (write) {
spin_lock(&hugetlb_lock);
h->nr_overcommit_huge_pages = tmp;
spin_unlock(&hugetlb_lock);
}

return 0;
out:
return ret;
}

#endif /* CONFIG_SYSCTL */
Expand Down

0 comments on commit 482ef66

Please sign in to comment.