linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] erofs: remove useless cache strategy of DELAYEDALLOC
@ 2021-11-06  8:23 Yue Hu
  2021-11-06 13:27 ` Gao Xiang
  0 siblings, 1 reply; 2+ messages in thread
From: Yue Hu @ 2021-11-06  8:23 UTC (permalink / raw)
  To: xiang, chao, linux-erofs
  Cc: linux-kernel, zhangwen, geshifei, zbestahu, Yue Hu

DELAYEDALLOC is not used at all, remove related dead code. Also,
remove the blank line at the end of zdata.h.

Signed-off-by: Yue Hu <huyue2@yulong.com>
---
v2: remove the blank line at the end of zdata.h.

 fs/erofs/zdata.c | 20 --------------------
 fs/erofs/zdata.h |  1 -
 2 files changed, 21 deletions(-)

diff --git a/fs/erofs/zdata.c b/fs/erofs/zdata.c
index bcb1b91b234f..812c7c6ae456 100644
--- a/fs/erofs/zdata.c
+++ b/fs/erofs/zdata.c
@@ -96,16 +96,9 @@ static void z_erofs_free_pcluster(struct z_erofs_pcluster *pcl)
 	DBG_BUGON(1);
 }
 
-/*
- * a compressed_pages[] placeholder in order to avoid
- * being filled with file pages for in-place decompression.
- */
-#define PAGE_UNALLOCATED     ((void *)0x5F0E4B1D)
-
 /* how to allocate cached pages for a pcluster */
 enum z_erofs_cache_alloctype {
 	DONTALLOC,	/* don't allocate any cached pages */
-	DELAYEDALLOC,	/* delayed allocation (at the time of submitting io) */
 	/*
 	 * try to use cached I/O if page allocation succeeds or fallback
 	 * to in-place I/O instead to avoid any direct reclaim.
@@ -267,10 +260,6 @@ static void preload_compressed_pages(struct z_erofs_collector *clt,
 			/* I/O is needed, no possible to decompress directly */
 			standalone = false;
 			switch (type) {
-			case DELAYEDALLOC:
-				t = tagptr_init(compressed_page_t,
-						PAGE_UNALLOCATED);
-				break;
 			case TRYALLOC:
 				newpage = erofs_allocpage(pagepool, gfp);
 				if (!newpage)
@@ -1089,15 +1078,6 @@ static struct page *pickup_page_for_submission(struct z_erofs_pcluster *pcl,
 	if (!page)
 		goto out_allocpage;
 
-	/*
-	 * the cached page has not been allocated and
-	 * an placeholder is out there, prepare it now.
-	 */
-	if (page == PAGE_UNALLOCATED) {
-		tocache = true;
-		goto out_allocpage;
-	}
-
 	/* process the target tagged pointer */
 	t = tagptr_init(compressed_page_t, page);
 	justfound = tagptr_unfold_tags(t);
diff --git a/fs/erofs/zdata.h b/fs/erofs/zdata.h
index 879df5362777..4a69515dea75 100644
--- a/fs/erofs/zdata.h
+++ b/fs/erofs/zdata.h
@@ -179,4 +179,3 @@ static inline void z_erofs_onlinepage_endio(struct page *page)
 #define Z_EROFS_VMAP_GLOBAL_PAGES	2048
 
 #endif
-
-- 
2.17.1




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

* Re: [PATCH v2] erofs: remove useless cache strategy of DELAYEDALLOC
  2021-11-06  8:23 [PATCH v2] erofs: remove useless cache strategy of DELAYEDALLOC Yue Hu
@ 2021-11-06 13:27 ` Gao Xiang
  0 siblings, 0 replies; 2+ messages in thread
From: Gao Xiang @ 2021-11-06 13:27 UTC (permalink / raw)
  To: Yue Hu
  Cc: xiang, chao, linux-erofs, linux-kernel, zhangwen, geshifei, zbestahu

Hi Yue,

On Sat, Nov 06, 2021 at 04:23:15PM +0800, Yue Hu wrote:
> DELAYEDALLOC is not used at all, remove related dead code. Also,
> remove the blank line at the end of zdata.h.

I'll update the commit message to:

After commit 1825c8d7ce93 ("erofs: force inplace I/O under low
memory scenario") and TRYALLOC is widely used, DELAYEDALLOC won't
be used anymore. Remove related dead code. Also, remove the blank
line at the end of zdata.h.

> 
> Signed-off-by: Yue Hu <huyue2@yulong.com>

Reviewed-by: Gao Xiang <hsiangkao@linux.alibaba.com>

Thanks,
Gao Xiang

> ---
> v2: remove the blank line at the end of zdata.h.
> 
>  fs/erofs/zdata.c | 20 --------------------
>  fs/erofs/zdata.h |  1 -
>  2 files changed, 21 deletions(-)
> 
> diff --git a/fs/erofs/zdata.c b/fs/erofs/zdata.c
> index bcb1b91b234f..812c7c6ae456 100644
> --- a/fs/erofs/zdata.c
> +++ b/fs/erofs/zdata.c
> @@ -96,16 +96,9 @@ static void z_erofs_free_pcluster(struct z_erofs_pcluster *pcl)
>  	DBG_BUGON(1);
>  }
>  
> -/*
> - * a compressed_pages[] placeholder in order to avoid
> - * being filled with file pages for in-place decompression.
> - */
> -#define PAGE_UNALLOCATED     ((void *)0x5F0E4B1D)
> -
>  /* how to allocate cached pages for a pcluster */
>  enum z_erofs_cache_alloctype {
>  	DONTALLOC,	/* don't allocate any cached pages */
> -	DELAYEDALLOC,	/* delayed allocation (at the time of submitting io) */
>  	/*
>  	 * try to use cached I/O if page allocation succeeds or fallback
>  	 * to in-place I/O instead to avoid any direct reclaim.
> @@ -267,10 +260,6 @@ static void preload_compressed_pages(struct z_erofs_collector *clt,
>  			/* I/O is needed, no possible to decompress directly */
>  			standalone = false;
>  			switch (type) {
> -			case DELAYEDALLOC:
> -				t = tagptr_init(compressed_page_t,
> -						PAGE_UNALLOCATED);
> -				break;
>  			case TRYALLOC:
>  				newpage = erofs_allocpage(pagepool, gfp);
>  				if (!newpage)
> @@ -1089,15 +1078,6 @@ static struct page *pickup_page_for_submission(struct z_erofs_pcluster *pcl,
>  	if (!page)
>  		goto out_allocpage;
>  
> -	/*
> -	 * the cached page has not been allocated and
> -	 * an placeholder is out there, prepare it now.
> -	 */
> -	if (page == PAGE_UNALLOCATED) {
> -		tocache = true;
> -		goto out_allocpage;
> -	}
> -
>  	/* process the target tagged pointer */
>  	t = tagptr_init(compressed_page_t, page);
>  	justfound = tagptr_unfold_tags(t);
> diff --git a/fs/erofs/zdata.h b/fs/erofs/zdata.h
> index 879df5362777..4a69515dea75 100644
> --- a/fs/erofs/zdata.h
> +++ b/fs/erofs/zdata.h
> @@ -179,4 +179,3 @@ static inline void z_erofs_onlinepage_endio(struct page *page)
>  #define Z_EROFS_VMAP_GLOBAL_PAGES	2048
>  
>  #endif
> -
> -- 
> 2.17.1
> 
> 

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

end of thread, other threads:[~2021-11-06 13:27 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-06  8:23 [PATCH v2] erofs: remove useless cache strategy of DELAYEDALLOC Yue Hu
2021-11-06 13:27 ` Gao Xiang

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).