+ mm-writeback-flush-plugged-io-in-wakeup_flusher_threads.patch added to -mm tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The patch titled
     Subject: mm, writeback: flush plugged IO in wakeup_flusher_threads()
has been added to the -mm tree.  Its filename is
     mm-writeback-flush-plugged-io-in-wakeup_flusher_threads.patch

This patch should soon appear at
    http://ozlabs.org/~akpm/mmots/broken-out/mm-writeback-flush-plugged-io-in-wakeup_flusher_threads.patch
and later at
    http://ozlabs.org/~akpm/mmotm/broken-out/mm-writeback-flush-plugged-io-in-wakeup_flusher_threads.patch

Before you just go and hit "reply", please:
   a) Consider who else should be cc'ed
   b) Prefer to cc a suitable mailing list as well
   c) Ideally: find the original patch on the mailing list and do a
      reply-to-all to that, adding suitable additional cc's

*** Remember to use Documentation/SubmitChecklist when testing your code ***

The -mm tree is included into linux-next and is updated
there every 3-4 working days

------------------------------------------------------
From: Konstantin Khlebnikov <khlebnikov@xxxxxxxxxxxxxx>
Subject: mm, writeback: flush plugged IO in wakeup_flusher_threads()

I've found funny livelock between raid10 barriers during resync and memory
controller hard limits.  Inside mpage_readpages() task holds on its plug
bio which blocks barrier in raid10.  Its memory cgroup have no free memory
thus task goes into reclaimer but all reclaimable pages are dirty and
cannot be written because raid10 is rebuilding and stuck on barrier.

Common flush of such IO in schedule() never happens because machine where
that happened has a lot of free cpus and task never goes sleep.

Lock is 'live' because changing memory limit or killing tasks which holds
that stuck bio unblock whole progress.

That was happened in 3.18.x but I see no difference in upstream logic.
Theoretically this might happen even without memory cgroup.

Link: http://lkml.kernel.org/r/147033576532.682609.2277943215598867297.stgit@buzz
Signed-off-by: Konstantin Khlebnikov <khlebnikov@xxxxxxxxxxxxxx>
Cc: Jens Axboe <axboe@xxxxxxxxx>
Cc: Michal Hocko <mhocko@xxxxxxxx>
Cc: Mel Gorman <mgorman@xxxxxxxxxxxxxxxxxxx>
Cc: Dave Chinner <dchinner@xxxxxxxxxx>
Cc: Tejun Heo <tj@xxxxxxxxxx>
Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
---

 fs/fs-writeback.c |    6 ++++++
 1 file changed, 6 insertions(+)

diff -puN fs/fs-writeback.c~mm-writeback-flush-plugged-io-in-wakeup_flusher_threads fs/fs-writeback.c
--- a/fs/fs-writeback.c~mm-writeback-flush-plugged-io-in-wakeup_flusher_threads
+++ a/fs/fs-writeback.c
@@ -1949,6 +1949,12 @@ void wakeup_flusher_threads(long nr_page
 {
 	struct backing_dev_info *bdi;
 
+	/*
+	 * If we are expecting writeback progress we must submit plugged IO.
+	 */
+	if (blk_needs_flush_plug(current))
+		blk_schedule_flush_plug(current);
+
 	if (!nr_pages)
 		nr_pages = get_nr_dirty_pages();
 
_

Patches currently in -mm which might be from khlebnikov@xxxxxxxxxxxxxx are

mm-writeback-flush-plugged-io-in-wakeup_flusher_threads.patch
kernel-watchdog-use-nmi-registers-snapshot-in-hardlockup-handler.patch

--
To unsubscribe from this list: send the line "unsubscribe mm-commits" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Kernel Archive]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]
  Powered by Linux