Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp6456925rwl; Wed, 22 Mar 2023 10:52:09 -0700 (PDT) X-Google-Smtp-Source: AK7set9sbEXq1h4P69T3CCYLf2iLF4Jaon+TRncjHLnhRYy3e+oPe7fC3l3cd7K1MXt/vo9ZxRD/ X-Received: by 2002:a17:903:4101:b0:1a1:dd05:39fe with SMTP id r1-20020a170903410100b001a1dd0539femr3199373pld.4.1679507529144; Wed, 22 Mar 2023 10:52:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679507529; cv=none; d=google.com; s=arc-20160816; b=CLWgRSeOBJViY0+gxh+gXU/iZ1aaH0jxIqFTXCV+RUkRGP4jqpqUpsjKyErMjApD/p uD13Q0+tv18LBfAw6TEuyV99YocsU5qE6vlH9MZCgeVOoT8Quv5R8+cj40YpUmQ0uX1U d6cYtRvQwPIRcNC6bhUuu8OVzi98YFxcKxycwnMLDLSb21j3it5/0mdunS2d/ggw+zOW /enGfdwHGH0V0ktQ+rJgKAgg8kpAhH+jWbEum1ahlM8L48N1UUVqrFN0jl8RR28U6n3e l7Ah0ZAtTYdb4LVr3x6ExzJzcjmMbKj2qNuNzDtt0NX1V3Hx79fiRoTSLKtdCODpqrF3 lBjg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=5U7snE0+aYLeGUT8P2wlcKvFPCtGDHM/aotSxqaNJaY=; b=fuPgmv9imJwNghCUjzLsJ1+m9dw2wqW6lUTANTw+X807VuVdSlRH6KXsCuQ8fWTUJ5 b/fWdXraybFU6sxaxOUP4owv8iYQJiDR2xg4GSRlLY6IFtUlGhzUQqBbzc3i2/YsxRQ7 6mWIfioKeImeI3zJyWPOHRiLw8gjhNrBDZGYdJfE+UVXUB7RgQcSh4aOPi/4ll0ji8jq Vpizv70XuSBTzNSOGIALH/TuN9GSJhKJ0XnYLup54CJQ03fHD9zkfGpg56kckrS83wJe LzZt876oedDdx7MwKhWokiNlrcqLkAYyaqstywLSU5jE0mKbmNZHIWSX7B/ncnX4h0KU L73A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=kRa6Gmr6; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id b10-20020a170902d50a00b001a1ddcfeba2si5714172plg.492.2023.03.22.10.51.57; Wed, 22 Mar 2023 10:52:09 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=kRa6Gmr6; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229889AbjCVRri (ORCPT + 99 others); Wed, 22 Mar 2023 13:47:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43222 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229477AbjCVRrh (ORCPT ); Wed, 22 Mar 2023 13:47:37 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1E0C15FEB8; Wed, 22 Mar 2023 10:47:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=5U7snE0+aYLeGUT8P2wlcKvFPCtGDHM/aotSxqaNJaY=; b=kRa6Gmr61/CqeuJfus2d86d5LH 8I7TRNzJAuYyRJK3566ZY/aV8ud0L7Ni7asXjiIcUh5tzJpC3b6SSQIz7ePhJkK1+P0qqt2Zt8CT7 JMZDTsQaGvD9+rfE12U0lzjc6njS/SFjWftGekcZJVZV6CSNmXJTveemmLLB8VX5QptyEJOZ/Z3EV xSb7MtWcVltTHKnReTp5Fxcm31HwcO3vd07oB4lN455EauTZ8xm6cEdSTz3jDXf894+/8TCCXkR51 vyTO3PFdAmHkPwon04jRo8QFkrQJ+WqbPAL4O5vt2LG1crSZBeiksKLWFm8rYua1AKscPYo/RIhPj /yRJCxaQ==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1pf2Ya-003DFb-CA; Wed, 22 Mar 2023 17:47:28 +0000 Date: Wed, 22 Mar 2023 17:47:28 +0000 From: Matthew Wilcox To: Uladzislau Rezki Cc: Dave Chinner , Lorenzo Stoakes , linux-mm@kvack.org, linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, Andrew Morton , Baoquan He , David Hildenbrand , Liu Shixin , Jiri Olsa Subject: Re: [PATCH v2 2/4] mm: vmalloc: use rwsem, mutex for vmap_area_lock and vmap_block->lock Message-ID: References: <6c7f1ac0aeb55faaa46a09108d3999e4595870d9.1679209395.git.lstoakes@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-2.5 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE,SPF_NONE, URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Mar 22, 2023 at 02:18:19PM +0100, Uladzislau Rezki wrote: > Hello, Dave. > > > > > I'm travelling right now, but give me a few days and I'll test this > > against the XFS workloads that hammer the global vmalloc spin lock > > really, really badly. XFS can use vm_map_ram and vmalloc really > > heavily for metadata buffers and hit the global spin lock from every > > CPU in the system at the same time (i.e. highly concurrent > > workloads). vmalloc is also heavily used in the hottest path > > throught the journal where we process and calculate delta changes to > > several million items every second, again spread across every CPU in > > the system at the same time. > > > > We really need the global spinlock to go away completely, but in the > > mean time a shared read lock should help a little bit.... > > > Could you please share some steps how to run your workloads in order to > touch vmalloc() code. I would like to have a look at it in more detail > just for understanding the workloads. > > Meanwhile my grep agains xfs shows: > > > urezki@pc638:~/data/raid0/coding/linux-rcu.git/fs/xfs$ grep -rn vmalloc ./ You're missing: fs/xfs/xfs_buf.c: bp->b_addr = vm_map_ram(bp->b_pages, bp->b_page_count, which i suspect is the majority of Dave's workload. That will almost certainly take the vb_alloc() path.