All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] ext4: no need to cond_resched() in ext4_trim_all_free()
@ 2017-04-27  8:36 Lukas Czerner
  2017-04-30  4:26 ` Theodore Ts'o
  0 siblings, 1 reply; 3+ messages in thread
From: Lukas Czerner @ 2017-04-27  8:36 UTC (permalink / raw)
  To: linux-ext4; +Cc: Lukas Czerner

There is no need to call cond_resched() in ext4_trim_all_free() since
blkdev_issue_discard() already takes care of that. So just remove it.

Signed-off-by: Lukas Czerner <lczerner@redhat.com>
---
 fs/ext4/mballoc.c | 6 ------
 1 file changed, 6 deletions(-)

diff --git a/fs/ext4/mballoc.c b/fs/ext4/mballoc.c
index 354dc1a..4879766 100644
--- a/fs/ext4/mballoc.c
+++ b/fs/ext4/mballoc.c
@@ -5163,12 +5163,6 @@ ext4_trim_all_free(struct super_block *sb, ext4_group_t group,
 			break;
 		}
 
-		if (need_resched()) {
-			ext4_unlock_group(sb, group);
-			cond_resched();
-			ext4_lock_group(sb, group);
-		}

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH 1/2] ext4: no need to cond_resched() in ext4_trim_all_free()
  2017-04-27  8:36 [PATCH 1/2] ext4: no need to cond_resched() in ext4_trim_all_free() Lukas Czerner
@ 2017-04-30  4:26 ` Theodore Ts'o
  2017-05-04 11:19   ` Lukas Czerner
  0 siblings, 1 reply; 3+ messages in thread
From: Theodore Ts'o @ 2017-04-30  4:26 UTC (permalink / raw)
  To: Lukas Czerner; +Cc: linux-ext4

On Thu, Apr 27, 2017 at 10:36:40AM +0200, Lukas Czerner wrote:
> There is no need to call cond_resched() in ext4_trim_all_free() since
> blkdev_issue_discard() already takes care of that. So just remove it.

Actually, it could be needed.  If minblocks is a small value, say 2,
and every other block in file system is allocated, then we could be in
the while loop for a long time.  That's a pretty unusual case, but
it's good to have the need_resched() check there.

						- Ted

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH 1/2] ext4: no need to cond_resched() in ext4_trim_all_free()
  2017-04-30  4:26 ` Theodore Ts'o
@ 2017-05-04 11:19   ` Lukas Czerner
  0 siblings, 0 replies; 3+ messages in thread
From: Lukas Czerner @ 2017-05-04 11:19 UTC (permalink / raw)
  To: Theodore Ts'o; +Cc: linux-ext4

On Sun, Apr 30, 2017 at 12:26:05AM -0400, Theodore Ts'o wrote:
> On Thu, Apr 27, 2017 at 10:36:40AM +0200, Lukas Czerner wrote:
> > There is no need to call cond_resched() in ext4_trim_all_free() since
> > blkdev_issue_discard() already takes care of that. So just remove it.
> 
> Actually, it could be needed.  If minblocks is a small value, say 2,
> and every other block in file system is allocated, then we could be in
> the while loop for a long time.  That's a pretty unusual case, but
> it's good to have the need_resched() check there.
> 
> 						- Ted

Fair enough, it's unusuall case, but still possible. Let's keep it this
way.

Thanks!
-Lukas

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-05-04 11:19 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-04-27  8:36 [PATCH 1/2] ext4: no need to cond_resched() in ext4_trim_all_free() Lukas Czerner
2017-04-30  4:26 ` Theodore Ts'o
2017-05-04 11:19   ` Lukas Czerner

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.