Thread (31 messages) 31 messages, 7 authors, 2021-09-22

Re: [PATCH 1/5] mm/vmscan: Throttle reclaim until some writeback completes if congested

From: Mel Gorman <hidden>
Date: 2021-09-22 14:13:10
Also in: lkml

On Wed, Sep 22, 2021 at 08:16:20PM +0800, Hillf Danton wrote:
On Mon, 20 Sep 2021 09:54:32 +0100 Mel Gorman wrote:
quoted
+static void
+reclaim_throttle(pg_data_t *pgdat, enum vmscan_throttle_state reason,
+							long timeout)
+{
+	wait_queue_head_t *wqh =3D &pgdat->reclaim_wait;
+	unsigned long start =3D jiffies;
+	long ret;
+	DEFINE_WAIT(wait);
+
+	atomic_inc(&pgdat->nr_reclaim_throttled);
+	WRITE_ONCE(pgdat->nr_reclaim_start,
+		 node_page_state(pgdat, NR_THROTTLED_WRITTEN));
Missing wakeup could happen if the current sleeper overwrites 
pgdat->nr_reclaim_start set by the existing sleeper.

	if (1 == atomic_inc_and_return(&pgdat->nr_reclaim_throttled))
		WRITE_ONCE(pgdat->nr_reclaim_start,
				node_page_state(pgdat, NR_THROTTLED_WRITTEN));
Good spot, will fix.

-- 
Mel Gorman
SUSE Labs
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help