[Devel] [PATCH RHEL7 COMMIT] ve/fs/files: always try to shrink big fdtables, not only on CT restore

Konstantin Khorenko khorenko at virtuozzo.com
Thu Jan 18 18:11:32 MSK 2018


The commit is pushed to "branch-rh7-3.10.0-693.11.6.vz7.42.x-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git
after rh7-3.10.0-693.11.6.vz7.42.1
------>
commit 1b1d776f7dad4783c7715ce88a058ae4ab3a4dc5
Author: Konstantin Khorenko <khorenko at virtuozzo.com>
Date:   Thu Jan 18 18:06:09 2018 +0300

    ve/fs/files: always try to shrink big fdtables, not only on CT restore
    
    We want to:
    1) test this code carefully => execute it heavily, not only on CT restore
    2) check if fdtable shrink influences the performance
    
    => let's always try to shrink fstable on each fd close.
    
    This patch may be reverted before next product update in case we see
    no noticable benefit in memory usage and performance drop.
    
    https://jira.sw.ru/browse/PSBM-78827
    
    Signed-off-by: Konstantin Khorenko <khorenko at virtuozzo.com>
---
 fs/file.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/fs/file.c b/fs/file.c
index b85e8ee6143b..2dbac23ebefe 100644
--- a/fs/file.c
+++ b/fs/file.c
@@ -663,9 +663,7 @@ int __close_fd(struct files_struct *files, unsigned fd)
 
 	/* Try to shrink fdt and to free memory */
 	if (unlikely(fd * 2 >= fdt->max_fds &&
-		     fd > (1024 / sizeof(struct file *))) &&
-		     get_exec_env() != get_ve0() &&
-		     get_exec_env()->is_pseudosuper)
+		     fd > (1024 / sizeof(struct file *))))
 		expand_files(files, fd, true);
 
 	spin_unlock(&files->file_lock);


More information about the Devel mailing list