aboutsummaryrefslogtreecommitdiffstats
path: root/mm/shmem.c
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2017-02-07 16:29:30 -0500
committerDavid S. Miller <davem@davemloft.net>2017-02-07 16:29:30 -0500
commit3efa70d78f218e4c9276b0bac0545e5184c1c47b (patch)
treef4abe2f05e173023d2a262afd4aebb1e89fe6985 /mm/shmem.c
parent76e0e70e6452b971a69cc9794ff4a6715c11f7f2 (diff)
parent926af6273fc683cd98cd0ce7bf0d04a02eed6742 (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
The conflict was an interaction between a bug fix in the netvsc driver in 'net' and an optimization of the RX path in 'net-next'. Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'mm/shmem.c')
-rw-r--r--mm/shmem.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/mm/shmem.c b/mm/shmem.c
index bb53285a1d99..3a7587a0314d 100644
--- a/mm/shmem.c
+++ b/mm/shmem.c
@@ -415,6 +415,7 @@ static unsigned long shmem_unused_huge_shrink(struct shmem_sb_info *sbinfo,
415 struct shrink_control *sc, unsigned long nr_to_split) 415 struct shrink_control *sc, unsigned long nr_to_split)
416{ 416{
417 LIST_HEAD(list), *pos, *next; 417 LIST_HEAD(list), *pos, *next;
418 LIST_HEAD(to_remove);
418 struct inode *inode; 419 struct inode *inode;
419 struct shmem_inode_info *info; 420 struct shmem_inode_info *info;
420 struct page *page; 421 struct page *page;
@@ -441,9 +442,8 @@ static unsigned long shmem_unused_huge_shrink(struct shmem_sb_info *sbinfo,
441 /* Check if there's anything to gain */ 442 /* Check if there's anything to gain */
442 if (round_up(inode->i_size, PAGE_SIZE) == 443 if (round_up(inode->i_size, PAGE_SIZE) ==
443 round_up(inode->i_size, HPAGE_PMD_SIZE)) { 444 round_up(inode->i_size, HPAGE_PMD_SIZE)) {
444 list_del_init(&info->shrinklist); 445 list_move(&info->shrinklist, &to_remove);
445 removed++; 446 removed++;
446 iput(inode);
447 goto next; 447 goto next;
448 } 448 }
449 449
@@ -454,6 +454,13 @@ next:
454 } 454 }
455 spin_unlock(&sbinfo->shrinklist_lock); 455 spin_unlock(&sbinfo->shrinklist_lock);
456 456
457 list_for_each_safe(pos, next, &to_remove) {
458 info = list_entry(pos, struct shmem_inode_info, shrinklist);
459 inode = &info->vfs_inode;
460 list_del_init(&info->shrinklist);
461 iput(inode);
462 }
463
457 list_for_each_safe(pos, next, &list) { 464 list_for_each_safe(pos, next, &list) {
458 int ret; 465 int ret;
459 466