From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 932F4C54798 for ; Thu, 29 Feb 2024 10:38:11 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 1124F6B00D2; Thu, 29 Feb 2024 05:38:11 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 0BFFB6B00D4; Thu, 29 Feb 2024 05:38:11 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id EC9456B00D5; Thu, 29 Feb 2024 05:38:10 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id DC7A46B00D3 for ; Thu, 29 Feb 2024 05:38:10 -0500 (EST) Received: from smtpin18.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id 7FA411C153B for ; Thu, 29 Feb 2024 10:38:10 +0000 (UTC) X-FDA: 81844491540.18.7C536F5 Received: from mail-lj1-f174.google.com (mail-lj1-f174.google.com [209.85.208.174]) by imf02.hostedemail.com (Postfix) with ESMTP id AA2248000F for ; Thu, 29 Feb 2024 10:38:08 +0000 (UTC) Authentication-Results: imf02.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=mV4L1Plr; spf=pass (imf02.hostedemail.com: domain of urezki@gmail.com designates 209.85.208.174 as permitted sender) smtp.mailfrom=urezki@gmail.com; dmarc=pass (policy=none) header.from=gmail.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1709203088; a=rsa-sha256; cv=none; b=y/uGhfzzgtWRAP/ol5j5Z/f5UukZHhT5d881dPCVJx0NNWeDHtWhH9sJ6P+r9aJwJHQZgl iC9jUtiop3hUhzsVGuiXgtFrCvxK43fTjKGXem3dfzXlZ3G9TGeI41I2VuCyUj1zM0D5cc pCjb/cd/6CURYn3D3HBFg/4qafJk7FI= ARC-Authentication-Results: i=1; imf02.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=mV4L1Plr; spf=pass (imf02.hostedemail.com: domain of urezki@gmail.com designates 209.85.208.174 as permitted sender) smtp.mailfrom=urezki@gmail.com; dmarc=pass (policy=none) header.from=gmail.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1709203088; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=dTKpNPeuSgy8sWWECv3I3qZ2/zuDDquRsgKltwH/73E=; b=xDnO4dNyWgPEompMPxzY7lzhHWGCanqCdfFrW4j69Z0J6rciz79j6FpBZSODDaHnT6ECQ8 r6jAKyGDhsp4qny3Cjnc0lQ5o4MBbdJrZOEwPN6RpyY/UbREiPW4BZYvEzEGAAK9w4rhcR e5u6MDTMVNEVgyNC6IT98BqcpqZfjC0= Received: by mail-lj1-f174.google.com with SMTP id 38308e7fff4ca-2d2ab9c5e83so8122081fa.2 for ; Thu, 29 Feb 2024 02:38:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1709203087; x=1709807887; darn=kvack.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:date:from:from:to:cc:subject:date:message-id:reply-to; bh=dTKpNPeuSgy8sWWECv3I3qZ2/zuDDquRsgKltwH/73E=; b=mV4L1Plr+ta7hTnKzawcNlH297N3+BIoXSSBOe9eiHLzJsVF0b1Ogc95onhKogaVfY 5/IbWk5NcZU4UmwhQK2rNRGsaWzn/EfLtpRCPzr6WRIrbCXsToloQduhloR1qgH/H6Qg hDmO793By3wJrMh1KxAalMCItPugUgky4oRVha120alYlLD3Kmsi1QV95yNU2pVXowKB mThxeqcYVAseKHZz/6wHSyUPONeUTdWe3BXdZ8Ntn0arNgIoOPtdqxz8pSD7HAbCpbGg 81EjzgLFsYXnpZIDW/AriyncQxhjWyEK8gzl/EIuyGB58D8X6PLXBxhIKPtYrgm61L/H s2HA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709203087; x=1709807887; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:date:from:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=dTKpNPeuSgy8sWWECv3I3qZ2/zuDDquRsgKltwH/73E=; b=kVelrk8vNbX9vrXe8PT6fsWt8NirhTBSF1LKNCg+OO3U3y2/Z4jzHOGaa+paEGlZHj cPYnDP6DBu2yHGuUpCCtLNffOFs9p9W2XsuTsq8SLWPpjSedsuRPFCL5uIxvJ9+OfISk 66jQwj5N1T2XewPg4a1gZPP+lOSvZ3Pp3STNA9cHE9f4cwhjKMNp6j1SD61eE9d+FNhz mH2sL4ZestNnJWZpvExl4d5evMKTvaWX8WT/V2Zk3axsBdwXE1yq4ERHr5v+CXFpLvoF Ud2kMDkyGNUkw9fPT7+YQxTT22P4vZagopMDB6Qs4e++wkYymaKsz/lWT8AMwj0fJlcU bqJw== X-Forwarded-Encrypted: i=1; AJvYcCXF6a+RvRvoyDYdsauZuQHr8YFD6F4yMuNoGw7q/FoTI5Upds0N8dyd7vC99q7LBWQhEOcwgU61ka3neD6y9NmNWGc= X-Gm-Message-State: AOJu0YwpouBbKGTl/XM7uVImdnQBLAx3G1u5XiKldsJG4egM8Dp4CeC+ lvWn427ysAz7Aj4LDG/WkpiP8BFx+6XSnC1Cqmzuk3kguECUgpYo X-Google-Smtp-Source: AGHT+IENQ75whmgA5sNBDTCKdsjXEpbjqVSppas6ddaiE25Z2aUtCtVGxWqqfIKeXW0ScrOnTLc09w== X-Received: by 2002:ac2:5dea:0:b0:513:1a94:f9ff with SMTP id z10-20020ac25dea000000b005131a94f9ffmr1102496lfq.3.1709203086649; Thu, 29 Feb 2024 02:38:06 -0800 (PST) Received: from pc636 (host-90-233-206-150.mobileonline.telia.com. [90.233.206.150]) by smtp.gmail.com with ESMTPSA id q26-20020ac2529a000000b00512b3c3f0f3sm203662lfm.86.2024.02.29.02.38.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 Feb 2024 02:38:06 -0800 (PST) From: Uladzislau Rezki X-Google-Original-From: Uladzislau Rezki Date: Thu, 29 Feb 2024 11:38:03 +0100 To: Baoquan He Cc: Uladzislau Rezki , Pedro Falcato , Matthew Wilcox , Mel Gorman , kirill.shutemov@linux.intel.com, Vishal Moola , Andrew Morton , LKML , Lorenzo Stoakes , Christoph Hellwig , "Liam R . Howlett" , Dave Chinner , "Paul E . McKenney" , Joel Fernandes , Oleksiy Avramchenko , linux-mm@kvack.org Subject: Re: [PATCH v3 00/11] Mitigate a vmap lock contention v3 Message-ID: References: <20240102184633.748113-1-urezki@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Rspamd-Server: rspam08 X-Rspamd-Queue-Id: AA2248000F X-Stat-Signature: qw4s6531fs3bi56f758ofpzb8h7ecdo5 X-Rspam-User: X-HE-Tag: 1709203088-964602 X-HE-Meta: U2FsdGVkX1+9pryzFzdlUueDJxLoxMh7CJ8edyMvMKEHsEsBa4zyQP9OZSS8zWq55NQR9Wo0gXB3NElICoLGB4VFAkVo1c9s2x7N2uGYZCR9qdlUaejpUQEwnhV7apT3prKS8L3aun4dSLhz3HBtt67dKSJNQOFkIupf4bbswCTXNSEALqGiiBEX50pqlZUomUL51wC6kd1Q5ostUa7sMR8at5YUBoDt2HjE2Vr1xXVZXgQJAuOhzmZCkhMP7BvBwe/tXMixEP2Eb0nkr/xugLfhcgRB4MovIo0AcdgUt4U1Q1ZaTi0ffaubtOQKwHmB/auDiXE7XTUX/K3H12Legz8jtx81lLz1774d1Q4ljgJDcLZjp+HZbx07OGIdelxgaI3tE8P4usfvwtNxpS7LH5z+fnHSmRFuvvftbgogyTWuBKCNiV+iLl5O7ZoIvfr44fP2oOVBVDNAhZg6irbk8GEo7yvBP/dTUTMoaReWPvLQA4RqCNstmxBsGHtg1tWs6Pkh0CoKPcSnl15dcjAQhcDRIIGIn4LzLBvsLhgtpZvEQjubReSSl2GzL5tCPgwGeM69uC4Wvbi5kXqkbXq7ez9PblYxugQui6Mo5jiaf4MHscONjnPyCBeB4fVdmegznMQ94XXNZFIp9k6VYGURbMAe/cwZKob/2iIDWIvkb8D7s8LS+XD4gMRRDHJlP82NOtMYDc2m8iYNkFC2nR1dg8hkgNArpA0mbkhjcF2VvnjD2wBhcX+jvZSknRdIzEPARcg1/1LHSrXXptmJ01SgvZif0TbMsAK8C6cLjoKwdk4eV/PyhMlGIoYAdjc1mmmQSXZGVB0FF0EHPy0zbtZVk2HEbz/mfMlkUxfhW8Xda8t7L+de3yKitXmLTvVHIP3PpYpXiAvptLifQ17kHXSsRFs3+AcA5iDkIL49KYtoEaN3MrIfyJJpWGlyk7BnnUGtQYeM97/DhmLGEkW1wfd 01h5a9CE y4cLbvODgOJJrAXcDpx4SZ7JxQ1Ob+IqaPUqnfYXZQ8wO+y+pwA8TkWNsb9IK6J1aOYou7pSa7BqdFv+z53LhEJPuj6Pci+NMMPoUt+Jii7rmEGHaPN879HbzDQrKSXtcq3wkJtsgezlrII1fGtVdR/1ntQ== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: > > I finally finished the testing w/o and with your above improvement > patch. Testing is done on a system with 128 cpus. The system with 288 > cpus is not available because of some console connection. Attach the log > here. In some testing after rebooting, I found it could take more than 30 > minutes, I am not sure if it's caused by my messy code change. I finally > cleaned up all of them and take a clean linux-next to test, then apply > your above draft code. > [root@dell-per6515-03 linux]# nproc > 128 > [root@dell-per6515-03 linux]# free -h > total used free shared buff/cache available > Mem: 124Gi 2.6Gi 122Gi 21Mi 402Mi 122Gi > Swap: 4.0Gi 0B 4.0Gi > > 1)linux-next kernel w/o improving code from Uladzislau > ------------------------------------------------------- > [root@dell-per6515-03 linux]# time tools/testing/selftests/mm/test_vmalloc.sh run_test_mask=127 nr_threads=64 > Run the test with following parameters: run_test_mask=127 nr_threads=64 > Done. > Check the kernel ring buffer to see the summary. > > real 4m28.018s > user 0m0.015s > sys 0m4.712s > [root@dell-per6515-03 ~]# sort -h /proc/allocinfo | tail -10 > 21405696 5226 mm/memory.c:1122 func:folio_prealloc > 26199936 7980 kernel/fork.c:309 func:alloc_thread_stack_node > 29822976 7281 mm/readahead.c:247 func:page_cache_ra_unbounded > 99090432 96768 drivers/iommu/iova.c:604 func:iova_magazine_alloc > 107638784 6320 mm/readahead.c:468 func:ra_alloc_folio > 120560528 29439 mm/mm_init.c:2521 func:alloc_large_system_hash > 134742016 32896 mm/percpu-vm.c:95 func:pcpu_alloc_pages > 263192576 64256 mm/page_ext.c:270 func:alloc_page_ext > 266797056 65136 include/linux/mm.h:2848 func:pagetable_alloc > 507617280 32796 mm/slub.c:2305 func:alloc_slab_page > [root@dell-per6515-03 ~]# > [root@dell-per6515-03 ~]# > [root@dell-per6515-03 linux]# time tools/testing/selftests/mm/test_vmalloc.sh run_test_mask=127 nr_threads=128 > Run the test with following parameters: run_test_mask=127 nr_threads=128 > Done. > Check the kernel ring buffer to see the summary. > > real 6m19.328s > user 0m0.005s > sys 0m9.476s > [root@dell-per6515-03 ~]# sort -h /proc/allocinfo | tail -10 > 21405696 5226 mm/memory.c:1122 func:folio_prealloc > 26889408 8190 kernel/fork.c:309 func:alloc_thread_stack_node > 29822976 7281 mm/readahead.c:247 func:page_cache_ra_unbounded > 99090432 96768 drivers/iommu/iova.c:604 func:iova_magazine_alloc > 107638784 6320 mm/readahead.c:468 func:ra_alloc_folio > 120560528 29439 mm/mm_init.c:2521 func:alloc_large_system_hash > 134742016 32896 mm/percpu-vm.c:95 func:pcpu_alloc_pages > 263192576 64256 mm/page_ext.c:270 func:alloc_page_ext > 550068224 34086 mm/slub.c:2305 func:alloc_slab_page > 664535040 162240 include/linux/mm.h:2848 func:pagetable_alloc > [root@dell-per6515-03 ~]# > [root@dell-per6515-03 ~]# > [root@dell-per6515-03 linux]# time tools/testing/selftests/mm/test_vmalloc.sh run_test_mask=127 nr_threads=256 > Run the test with following parameters: run_test_mask=127 nr_threads=256 > Done. > Check the kernel ring buffer to see the summary. > > real 19m10.657s > user 0m0.015s > sys 0m20.959s > [root@dell-per6515-03 ~]# sort -h /proc/allocinfo | tail -10 > 22441984 5479 mm/shmem.c:1634 func:shmem_alloc_folio > 26758080 8150 kernel/fork.c:309 func:alloc_thread_stack_node > 35880960 8760 mm/readahead.c:247 func:page_cache_ra_unbounded > 99090432 96768 drivers/iommu/iova.c:604 func:iova_magazine_alloc > 120560528 29439 mm/mm_init.c:2521 func:alloc_large_system_hash > 122355712 7852 mm/readahead.c:468 func:ra_alloc_folio > 134742016 32896 mm/percpu-vm.c:95 func:pcpu_alloc_pages > 263192576 64256 mm/page_ext.c:270 func:alloc_page_ext > 708231168 50309 mm/slub.c:2305 func:alloc_slab_page > 1107296256 270336 include/linux/mm.h:2848 func:pagetable_alloc > [root@dell-per6515-03 ~]# > > 2)linux-next kernel with improving code from Uladzislau > ----------------------------------------------------- > [root@dell-per6515-03 linux]# time tools/testing/selftests/mm/test_vmalloc.sh run_test_mask=127 nr_threads=64 > Run the test with following parameters: run_test_mask=127 nr_threads=64 > Done. > Check the kernel ring buffer to see the summary. > > real 4m27.226s > user 0m0.006s > sys 0m4.709s > [root@dell-per6515-03 linux]# sort -h /proc/allocinfo | tail -10 > 38023168 9283 mm/readahead.c:247 func:page_cache_ra_unbounded > 72228864 17634 fs/xfs/xfs_buf.c:390 [xfs] func:xfs_buf_alloc_pages > 99090432 96768 drivers/iommu/iova.c:604 func:iova_magazine_alloc > 99863552 97523 fs/xfs/xfs_icache.c:81 [xfs] func:xfs_inode_alloc > 120560528 29439 mm/mm_init.c:2521 func:alloc_large_system_hash > 136314880 33280 mm/percpu-vm.c:95 func:pcpu_alloc_pages > 184176640 10684 mm/readahead.c:468 func:ra_alloc_folio > 263192576 64256 mm/page_ext.c:270 func:alloc_page_ext > 284700672 69507 include/linux/mm.h:2848 func:pagetable_alloc > 601427968 36377 mm/slub.c:2305 func:alloc_slab_page > [root@dell-per6515-03 linux]# time tools/testing/selftests/mm/test_vmalloc.sh run_test_mask=127 nr_threads=128 > Run the test with following parameters: run_test_mask=127 nr_threads=128 > Done. > Check the kernel ring buffer to see the summary. > > real 6m16.960s > user 0m0.007s > sys 0m9.465s > [root@dell-per6515-03 linux]# sort -h /proc/allocinfo | tail -10 > 38158336 9316 mm/readahead.c:247 func:page_cache_ra_unbounded > 72220672 17632 fs/xfs/xfs_buf.c:390 [xfs] func:xfs_buf_alloc_pages > 99090432 96768 drivers/iommu/iova.c:604 func:iova_magazine_alloc > 99863552 97523 fs/xfs/xfs_icache.c:81 [xfs] func:xfs_inode_alloc > 120560528 29439 mm/mm_init.c:2521 func:alloc_large_system_hash > 136314880 33280 mm/percpu-vm.c:95 func:pcpu_alloc_pages > 184504320 10710 mm/readahead.c:468 func:ra_alloc_folio > 263192576 64256 mm/page_ext.c:270 func:alloc_page_ext > 427884544 104464 include/linux/mm.h:2848 func:pagetable_alloc > 697311232 45159 mm/slub.c:2305 func:alloc_slab_page > [root@dell-per6515-03 linux]# time tools/testing/selftests/mm/test_vmalloc.sh run_test_mask=127 nr_threads=256 > Run the test with following parameters: run_test_mask=127 nr_threads=256 > Done. > Check the kernel ring buffer to see the summary. > > real 21m15.673s > user 0m0.008s > sys 0m20.259s > [root@dell-per6515-03 linux]# sort -h /proc/allocinfo | tail -10 > 38158336 9316 mm/readahead.c:247 func:page_cache_ra_unbounded > 72224768 17633 fs/xfs/xfs_buf.c:390 [xfs] func:xfs_buf_alloc_pages > 99090432 96768 drivers/iommu/iova.c:604 func:iova_magazine_alloc > 99863552 97523 fs/xfs/xfs_icache.c:81 [xfs] func:xfs_inode_alloc > 120560528 29439 mm/mm_init.c:2521 func:alloc_large_system_hash > 136314880 33280 mm/percpu-vm.c:95 func:pcpu_alloc_pages > 184504320 10710 mm/readahead.c:468 func:ra_alloc_folio > 263192576 64256 mm/page_ext.c:270 func:alloc_page_ext > 506974208 123773 include/linux/mm.h:2848 func:pagetable_alloc > 809504768 53621 mm/slub.c:2305 func:alloc_slab_page > [root@dell-per6515-03 linux]# time tools/testing/selftests/mm/test_vmalloc.sh run_test_mask=127 nr_threads=256 > Run the test with following parameters: run_test_mask=127 nr_threads=256 > Done. > Check the kernel ring buffer to see the summary. > > real 21m36.580s > user 0m0.012s > sys 0m19.912s > [root@dell-per6515-03 linux]# sort -h /proc/allocinfo | tail -10 > 38977536 9516 mm/readahead.c:247 func:page_cache_ra_unbounded > 72273920 17645 fs/xfs/xfs_buf.c:390 [xfs] func:xfs_buf_alloc_pages > 99090432 96768 drivers/iommu/iova.c:604 func:iova_magazine_alloc > 99895296 97554 fs/xfs/xfs_icache.c:81 [xfs] func:xfs_inode_alloc > 120560528 29439 mm/mm_init.c:2521 func:alloc_large_system_hash > 141033472 34432 mm/percpu-vm.c:95 func:pcpu_alloc_pages > 186064896 10841 mm/readahead.c:468 func:ra_alloc_folio > 263192576 64256 mm/page_ext.c:270 func:alloc_page_ext > 541237248 132138 include/linux/mm.h:2848 func:pagetable_alloc > 694718464 41216 mm/slub.c:2305 func:alloc_slab_page > > Thank you for testing this. So ~132mb with a patch. I think it looks good but i might change the draft version and send out a new version. Thank you again! -- Uladzislau Rezki