From 273d4428f8c4cc94c9598f8bcc006ec2e8c654ea Mon Sep 17 00:00:00 2001 From: André Fabian Silva Delgado Date: Sun, 11 Sep 2016 05:04:00 -0300 Subject: Linux-libre 4.7.2-gnu --- mm/backing-dev.c | 19 +++++++++++++++++++ mm/hugetlb.c | 4 ++++ 2 files changed, 23 insertions(+) (limited to 'mm') diff --git a/mm/backing-dev.c b/mm/backing-dev.c index 6a7265de8..86a87de7f 100644 --- a/mm/backing-dev.c +++ b/mm/backing-dev.c @@ -826,6 +826,20 @@ int bdi_register_dev(struct backing_dev_info *bdi, dev_t dev) } EXPORT_SYMBOL(bdi_register_dev); +int bdi_register_owner(struct backing_dev_info *bdi, struct device *owner) +{ + int rc; + + rc = bdi_register(bdi, NULL, "%u:%u", MAJOR(owner->devt), + MINOR(owner->devt)); + if (rc) + return rc; + bdi->owner = owner; + get_device(owner); + return 0; +} +EXPORT_SYMBOL(bdi_register_owner); + /* * Remove bdi from bdi_list, and ensure that it is no longer visible */ @@ -850,6 +864,11 @@ void bdi_unregister(struct backing_dev_info *bdi) device_unregister(bdi->dev); bdi->dev = NULL; } + + if (bdi->owner) { + put_device(bdi->owner); + bdi->owner = NULL; + } } void bdi_exit(struct backing_dev_info *bdi) diff --git a/mm/hugetlb.c b/mm/hugetlb.c index addfe4acc..d9ec1a5b3 100644 --- a/mm/hugetlb.c +++ b/mm/hugetlb.c @@ -2214,6 +2214,10 @@ static unsigned long set_max_huge_pages(struct hstate *h, unsigned long count, * and reducing the surplus. */ spin_unlock(&hugetlb_lock); + + /* yield cpu to avoid soft lockup */ + cond_resched(); + if (hstate_is_gigantic(h)) ret = alloc_fresh_gigantic_page(h, nodes_allowed); else -- cgit v1.2.3-54-g00ecf