All of lore.kernel.org
 help / color / mirror / Atom feed
From: Minchan Kim <minchan@kernel.org>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: linux-kernel@vger.kernel.org, linux-mm <linux-mm@kvack.org>,
	Minchan Kim <minchan@kernel.org>,
	"Aneesh Kumar K . V" <aneesh.kumar@linux.ibm.com>,
	Harish Sriram <harish@linux.ibm.com>,
	stable@vger.kernel.org
Subject: [PATCH] Revert "mm/vunmap: add cond_resched() in vunmap_pmd_range"
Date: Thu,  5 Nov 2020 09:02:49 -0800	[thread overview]
Message-ID: <20201105170249.387069-1-minchan@kernel.org> (raw)

This reverts commit e47110e90584a22e9980510b00d0dfad3a83354e.

While I was doing zram testing, I found sometimes decompression failed
since the compression buffer was corrupted. With investigation,
I found below commit calls cond_resched unconditionally so it could
make a problem in atomic context if the task is reschedule.

Revert the original commit for now.

[   55.109012] BUG: sleeping function called from invalid context at mm/vmalloc.c:108^M
[   55.110774] in_atomic(): 1, irqs_disabled(): 0, non_block: 0, pid: 946, name: memhog^M
[   55.111973] 3 locks held by memhog/946:^M
[   55.112807]  #0: ffff9d01d4b193e8 (&mm->mmap_lock#2){++++}-{4:4}, at: __mm_populate+0x103/0x160^M
[   55.114151]  #1: ffffffffa3d53de0 (fs_reclaim){+.+.}-{0:0}, at: __alloc_pages_slowpath.constprop.0+0xa98/0x1160^M
[   55.115848]  #2: ffff9d01d56b8110 (&zspage->lock){.+.+}-{3:3}, at: zs_map_object+0x8e/0x1f0^M
[   55.118947] CPU: 0 PID: 946 Comm: memhog Not tainted 5.9.3-00011-gc5bfc0287345-dirty #316^M
[   55.121265] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.13.0-1 04/01/2014^M
[   55.122540] Call Trace:^M
[   55.122974]  dump_stack+0x8b/0xb8^M
[   55.123588]  ___might_sleep.cold+0xb6/0xc6^M
[   55.124328]  unmap_kernel_range_noflush+0x2eb/0x350^M
[   55.125198]  unmap_kernel_range+0x14/0x30^M
[   55.125920]  zs_unmap_object+0xd5/0xe0^M
[   55.126604]  zram_bvec_rw.isra.0+0x38c/0x8e0^M
[   55.127462]  zram_rw_page+0x90/0x101^M
[   55.128199]  bdev_write_page+0x92/0xe0^M
[   55.128957]  ? swap_slot_free_notify+0xb0/0xb0^M
[   55.129841]  __swap_writepage+0x94/0x4a0^M
[   55.130636]  ? do_raw_spin_unlock+0x4b/0xa0^M
[   55.131462]  ? _raw_spin_unlock+0x1f/0x30^M
[   55.132261]  ? page_swapcount+0x6c/0x90^M
[   55.133038]  pageout+0xe3/0x3a0^M
[   55.133702]  shrink_page_list+0xb94/0xd60^M
[   55.134626]  shrink_inactive_list+0x158/0x460^M

Cc: Aneesh Kumar K.V <aneesh.kumar@linux.ibm.com>
Cc: Harish Sriram <harish@linux.ibm.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Minchan Kim <minchan@kernel.org>
---
 mm/vmalloc.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/mm/vmalloc.c b/mm/vmalloc.c
index 6ae491a8b210..a4f1d39ce710 100644
--- a/mm/vmalloc.c
+++ b/mm/vmalloc.c
@@ -102,8 +102,6 @@ static void vunmap_pmd_range(pud_t *pud, unsigned long addr, unsigned long end,
 		if (pmd_none_or_clear_bad(pmd))
 			continue;
 		vunmap_pte_range(pmd, addr, next, mask);
-
-		cond_resched();
 	} while (pmd++, addr = next, addr != end);
 }
 
-- 
2.29.1.341.ge80a0c044ae-goog



             reply	other threads:[~2020-11-05 17:02 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-05 17:02 Minchan Kim [this message]
2020-11-05 17:16 ` [PATCH] Revert "mm/vunmap: add cond_resched() in vunmap_pmd_range" Matthew Wilcox
2020-11-05 17:33   ` Minchan Kim
2020-11-07  1:59 ` Andrew Morton
2020-11-07  8:39   ` Minchan Kim
2020-11-09 11:33     ` Uladzislau Rezki
2020-11-12 20:01     ` Minchan Kim
2020-11-12 22:49       ` Andrew Morton
2020-11-13 16:25         ` Minchan Kim
2020-11-16 17:53           ` Minchan Kim
2020-11-16 23:20             ` Andrew Morton
2020-11-17 13:57               ` Uladzislau Rezki
2020-11-17 13:56             ` Christoph Hellwig
2020-11-17 20:29               ` Minchan Kim
2020-11-17 20:29                 ` Minchan Kim
2020-11-18  2:06                 ` Sergey Senozhatsky
2020-11-18  2:06                   ` Sergey Senozhatsky
2020-11-19  9:29                   ` Tony Lindgren
2020-11-19  9:29                     ` Tony Lindgren

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20201105170249.387069-1-minchan@kernel.org \
    --to=minchan@kernel.org \
    --cc=akpm@linux-foundation.org \
    --cc=aneesh.kumar@linux.ibm.com \
    --cc=harish@linux.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=stable@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.