reiserfs-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] reiser4: port for Linux-5.10
@ 2020-12-23  0:35 Edward Shishkin
  0 siblings, 0 replies; only message in thread
From: Edward Shishkin @ 2020-12-23  0:35 UTC (permalink / raw)
  To: ReiserFS development mailing list

[-- Attachment #1: Type: text/plain, Size: 136 bytes --]

Don't add/use PF_FLUSHER per task flag.
Instead add/use per reiser4_context flag flush_bd_task to indicate
that it is bd flushing task.

[-- Attachment #2: reiser4-get-rid-of-pf_flusher_flag.patch --]
[-- Type: text/x-patch, Size: 3661 bytes --]

diff -urN linux-5.8.10-reiser4/fs/fs-writeback.c linux-5.8.10/fs/fs-writeback.c
--- linux-5.8.10-reiser4/fs/fs-writeback.c	2020-10-11 21:00:01.000000000 +0200
+++ linux-5.8.10/fs/fs-writeback.c	2020-12-12 15:33:16.000000000 +0100
@@ -2090,7 +2090,7 @@
 	long pages_written;
 
 	set_worker_desc("flush-%s", bdi_dev_name(wb->bdi));
-	current->flags |= PF_FLUSHER | PF_SWAPWRITE;
+	current->flags |= PF_SWAPWRITE;
 
 	if (likely(!current_is_workqueue_rescuer() ||
 		   !test_bit(WB_registered, &wb->state))) {
diff -urN linux-5.8.10-reiser4/fs/reiser4/context.c linux-5.8.10/fs/reiser4/context.c
--- linux-5.8.10-reiser4/fs/reiser4/context.c	2020-10-11 20:55:06.000000000 +0200
+++ linux-5.8.10/fs/reiser4/context.c	2020-12-12 15:56:05.000000000 +0100
@@ -153,7 +153,7 @@
 	if (sbinfo != NULL && sbinfo->fake != NULL &&
 	    context->nr_marked_dirty != 0 &&
 	    !(current->flags & PF_MEMALLOC) &&
-	    !current_is_flush_bd_task())
+	    !context->flush_bd_task)
  		reiser4_throttle_write(sbinfo->fake);
 }
 
diff -urN linux-5.8.10-reiser4/fs/reiser4/context.h linux-5.8.10/fs/reiser4/context.h
--- linux-5.8.10-reiser4/fs/reiser4/context.h	2020-10-11 20:55:06.000000000 +0200
+++ linux-5.8.10/fs/reiser4/context.h	2020-12-12 16:46:39.000000000 +0100
@@ -64,6 +64,8 @@
 	unsigned int on_stack:1;
 	/* file system is read-only */
 	unsigned int ro:1;
+	/* replacement of PF_FLUSHER */
+	unsigned int flush_bd_task:1;
 
 	/* count non-trivial jnode_set_dirty() calls */
 	unsigned long nr_marked_dirty;
diff -urN linux-5.8.10-reiser4/fs/reiser4/super_ops.c linux-5.8.10/fs/reiser4/super_ops.c
--- linux-5.8.10-reiser4/fs/reiser4/super_ops.c	2020-10-11 20:55:06.000000000 +0200
+++ linux-5.8.10/fs/reiser4/super_ops.c	2020-12-12 15:49:06.000000000 +0100
@@ -383,6 +383,7 @@
 		spin_lock(&wb->list_lock);
 		goto skip;
 	}
+	ctx->flush_bd_task = 1;
 	/*
 	 * call reiser4_writepages for each of dirty inodes to turn
 	 * dirty pages into transactions if they were not yet.
diff -urN linux-5.8.10-reiser4/fs/reiser4/txnmgr.c linux-5.8.10/fs/reiser4/txnmgr.c
--- linux-5.8.10-reiser4/fs/reiser4/txnmgr.c	2020-10-11 20:55:06.000000000 +0200
+++ linux-5.8.10/fs/reiser4/txnmgr.c	2020-12-12 15:55:04.000000000 +0100
@@ -1413,7 +1413,7 @@
 		 * Write throttling is case of no one atom can be
 		 * flushed/committed.
 		 */
-		if (!current_is_flush_bd_task()) {
+		if (!ctx->flush_bd_task) {
 			list_for_each_entry(atom, &tmgr->atoms_list, atom_link) {
 				spin_lock_atom(atom);
 				/* Repeat the check from the above. */
diff -urN linux-5.8.10-reiser4/include/linux/sched.h linux-5.8.10/include/linux/sched.h
--- linux-5.8.10-reiser4/include/linux/sched.h	2020-10-11 20:55:06.000000000 +0200
+++ linux-5.8.10/include/linux/sched.h	2020-12-12 15:58:22.000000000 +0100
@@ -1483,7 +1483,6 @@
 /*
  * Per process flags
  */
-#define PF_FLUSHER              0x00000001      /* responsible for disk writeback */
 #define PF_IDLE			0x00000002	/* I am an IDLE thread */
 #define PF_EXITING		0x00000004	/* Getting shut down */
 #define PF_VCPU			0x00000010	/* I'm a virtual CPU */
diff -urN linux-5.8.10-reiser4/include/linux/writeback.h linux-5.8.10/include/linux/writeback.h
--- linux-5.8.10-reiser4/include/linux/writeback.h	2020-10-11 20:59:43.000000000 +0200
+++ linux-5.8.10/include/linux/writeback.h	2020-12-12 15:30:43.000000000 +0100
@@ -17,12 +17,6 @@
 
 DECLARE_PER_CPU(int, dirty_throttle_leaks);
 
-static inline int is_flush_bd_task(struct task_struct *task)
-{
-       return task->flags & PF_FLUSHER;
-}
-#define current_is_flush_bd_task()  is_flush_bd_task(current)
-
 /*
  * The 1/4 region under the global dirty thresh is for smooth dirty throttling:
  *

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2020-12-23  0:35 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-12-23  0:35 [PATCH] reiser4: port for Linux-5.10 Edward Shishkin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).