Skip to contentSkip to conversation

fs/fat: add cond_resched to fat_count_free_clusters

PATCH In review Khazhismel Kumykov 2 participants 2 messages Oct 10, 2018 – Oct 11, 2018 VFAT/FAT/msdos filesystem

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 fs/fat: add cond_resched to fat_count_free_clusters

On non-preempt kernels this loop can take a long time (more than 50 ticks) processing through entries.

---
 fs/fat/fatent.c | 1 +
 1 file changed, 1 insertion(+)
fs/fat/fatent.c +1 -0
index defc2168de91..f58c0cacc531 100644
@@ -682,6 +682,7 @@ int fat_count_free_clusters(struct super_block *sb)
 			if (ops->ent_get(&fatent) == FAT_ENT_FREE)
 				free++;
 		} while (fat_ent_next(sbi, &fatent));
+		cond_resched();
 	}
 	sbi->free_clusters = free;
 	sbi->free_clus_valid = 1;
Signature · 1 line
2.19.0.605.g01d371f741-goog
maintainer Acked-by on v1 1/1
#1 lore raw
Quoted 13 lines · Khazhismel Kumykov

On non-preempt kernels this loop can take a long time (more than 50 ticks) processing through entries.

---
 fs/fat/fatent.c | 1 +
 1 file changed, 1 insertion(+)
fs/fat/fatent.c +0 -0
index defc2168de91..f58c0cacc531 100644

fs/fat/fatent.c int fat_count_free_clusters(struct super_block *sb) · line 688

Quoted 7 lines
fs/fat/fatent.c +1 -0
@@ -682,6 +682,7 @@ int fat_count_free_clusters(struct super_block *sb)
 			if (ops->ent_get(&fatent) == FAT_ENT_FREE)
 				free++;
 		} while (fat_ent_next(sbi, &fatent));
+		cond_resched();
 	}
 	sbi->free_clusters = free;
 	sbi->free_clus_valid = 1;

Thanks, looks good.

Signature · 1 line
OGAWA Hirofumi <[email protected]>