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 lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 418F8CC6B36 for ; Thu, 2 Apr 2026 08:50:04 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.1271334.1559542 (Exim 4.92) (envelope-from ) id 1w8DkR-0001Us-1b; Thu, 02 Apr 2026 08:49:55 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 1271334.1559542; Thu, 02 Apr 2026 08:49:55 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1w8DkQ-0001Ul-U9; Thu, 02 Apr 2026 08:49:54 +0000 Received: by outflank-mailman (input) for mailman id 1271334; Thu, 02 Apr 2026 08:49:53 +0000 Received: from mx.expurgate.net ([195.190.135.10]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1w8DkP-0001Ud-5Y for xen-devel@lists.xenproject.org; Thu, 02 Apr 2026 08:49:53 +0000 Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp id 1w8DkO-001Ewa-7E for xen-devel@lists.xenproject.org; Thu, 02 Apr 2026 10:49:52 +0200 Received: from [10.42.69.8] (helo=localhost) by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from ) id 69ce2daa-e002-0a2a0a5209dd-0a2a45089892-34 for ; Thu, 02 Apr 2026 10:49:52 +0200 Received: from [209.85.221.49] (helo=mail-wr1-f49.google.com) by tlsNG-c1860d.mxtls.expurgate.net with ESMTPS (eXpurgate 4.56.0) (envelope-from ) id 69ce2daf-fab6-0a2a45080019-d155dd31d47f-3 for ; Thu, 02 Apr 2026 10:49:52 +0200 Received: by mail-wr1-f49.google.com with SMTP id ffacd0b85a97d-43cfbd17589so510493f8f.0 for ; Thu, 02 Apr 2026 01:49:52 -0700 (PDT) Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de. [37.24.206.209]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-43d1e4e221bsm5930563f8f.29.2026.04.02.01.49.50 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 02 Apr 2026 01:49:51 -0700 (PDT) X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=suse.com header.i="@suse.com" header.h="Content-Transfer-Encoding:In-Reply-To:Autocrypt:From:Content-Language:References:Cc:To:Subject:User-Agent:MIME-Version:Date:Message-ID" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=google; t=1775119791; x=1775724591; darn=lists.xenproject.org; h=content-transfer-encoding:in-reply-to:autocrypt:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:from:to:cc:subject:date:message-id:reply-to; bh=PJvtI6OmRB2GyErsUGjwbuj7RD4YiReTnFi8H3i0LD0=; b=QLKZ6OXnwtN0iUirZBsRxQ7m/fbgB96l8z0b/VpBpux4Cxealn4qjy1qwhMq0JJhzH thTtURpYE92i3RHdhGCxTDGZ9/OAmPrd3pVrVQYhGK+wNbMZBWX+6wNWjNUI1ESKzfiN WD13KVA6VlrI+aifwBj0vxexV5IFoievod/eNL0SHccGV8jIeUR/k/uVKtTu5mb+3l3g ef0SgwXm3tjvdYxH5t4lvnf9P9/Z6NhH8gceBdGKmMBhmtyTuewxckk48QmYqavukBTw Xcpwa8naWyuUVBeUFCZQZDVbr11LwvMY7wuyU+nawDTlZfmOWCXP79ELx45OoSIT0/Gg O13Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1775119791; x=1775724591; h=content-transfer-encoding:in-reply-to:autocrypt:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=PJvtI6OmRB2GyErsUGjwbuj7RD4YiReTnFi8H3i0LD0=; b=Xs86FW1XhxsuixQXO8tpd002T0jx6GN+a7bv4nVbdk0bF5vAAXQvP6ECh8uGWKu8u7 3ldEFbhjOT1H2R+LzYn9islGMQ9YjLSPXZfxUS56Ra2tleGQKm5089LYYUVDc+FkpYcB I3IbPKWtAdq+gpOteAZKBpvZDYFavoLEtrc77sdJ/tTGZqqCzLUPvAug/EEte029Mp1g gW0RpPZm3xVG9yUnvT/RDRrgZFjXEotCPvmgRhoREqidz8jcKMFAA+g0GYnLyQ71VJVy Z1f0NAjngv5HwgHCMZy5oJRHz8f8I1+VqUvfXBCDWTtiQqnluvc+FsMZMhTV9Y6IWXzH +nkg== X-Forwarded-Encrypted: i=1; AJvYcCXF9QCnTTMg2tcCSl1OLunR9ULXFCS0Jeu0UvXkvq54gKJ2Ev73KLg5nSTw+KO7YoJhbNQZ4uXohks=@lists.xenproject.org X-Gm-Message-State: AOJu0YzNnDNkCruwBDPs9Vy1CWDYV8EL9vqShfvdnT7MrdOzfXwW28S/ 5HAAS44sKyj4YIVXzL4ymnf9OXvd/aB1McnKInje7Gvx3FeK/RnOW+Z/U74Q7hdzbw== X-Gm-Gg: ATEYQzwWKu77kMpcj/IvZMcjFy2rS/If4QuygWADKCYkyvRNtE7Z2OjSksh2eXg8+r1 H1xtnpBlprtKolQjpt3A/7WSJoaeBAw0TgcJLfcBd+XVrW1zQvybPlS/PQ5q5oBaZsKk+DWYPuu 5MxWN8Ie1sLT89DlqzNDutCZrOlFnlchJ8EMiwl3CR+h+8fLU75ty5Fy6BC38VOKhwQ2hXUYehV tc7eyL8PkypwS2rg5WDkPB0oyuS0p9BGK7s1Ia0tH0f20hhMlRUzUgESDxEaXzmlXg6l96XUvzR tUrnbNr2xtvi0JC0itODmn91L1IJJOKD1g8q7yi5r/kgWkphzPgsXRisI0kC001m76bVLyRSZ1A 7GduDT1q8Zsul29uv4YbN1wlmfiqrPvOH8Xm7WP49XVwKsojyAehcgslzlZ8YWg4hvqJPz/RY4a Uq4kgwSPrID/KAT54hraTf9e+ySozK+d7oXiPVwZCZiO5tO2/1lw7jPN8DE+g/SErzKPIoCA1+V UlrGiRYtThDke8= X-Received: by 2002:a05:6000:230c:b0:43b:4273:a6ce with SMTP id ffacd0b85a97d-43d1504d2b4mr12438444f8f.3.1775119791495; Thu, 02 Apr 2026 01:49:51 -0700 (PDT) Message-ID: Date: Thu, 2 Apr 2026 10:49:50 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v1 0/3] Lockless SMP function call and TLB flushing To: Ross Lagerwall Cc: Andrew Cooper , =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= , Anthony PERARD , Michal Orzel , Julien Grall , Stefano Stabellini , xen-devel@lists.xenproject.org References: <20260401163521.3603665-1-ross.lagerwall@citrix.com> <94b2e444-844a-4d34-9c9f-de0b9e6e23b1@suse.com> <17c4e7b4-297a-4bf9-9160-659723d15e48@citrix.com> Content-Language: en-US From: Jan Beulich Autocrypt: addr=jbeulich@suse.com; keydata= xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF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5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A nAuWpQkjM1ASeQwSHEeAWPgskBQL In-Reply-To: <17c4e7b4-297a-4bf9-9160-659723d15e48@citrix.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-purgate-ID: tlsNG-c1860d/1775119792-94962497-DF860817/0/0 X-purgate-type: clean X-purgate-size: 2881 On 02.04.2026 10:40, Ross Lagerwall wrote: > On 4/2/26 7:09 AM, Jan Beulich wrote: >> On 01.04.2026 18:35, Ross Lagerwall wrote: >>> We have observed that the TLB flush lock can be a point of contention for >>> certain workloads, e.g. migrating 10 VMs off a host during a host evacuation. >>> >>> Performance numbers: >>> >>> I wrote a synthetic benchmark to measure the performance. The benchmark has one >>> or more CPUs in Xen calling on_selected_cpus() with between 1 and 64 CPUs in >>> the selected mask. The executed function simply delays for 500 microseconds. >>> >>> The table below shows the % change in execution time of on_selected_cpus(): >>> >>> 1 thread 2 threads 4 threads >>> 1 CPU in mask 0.02 -35.23 -51.18 >>> 2 CPUs in mask 0.01 -47.20 -69.27 >>> 4 CPUs in mask -0.02 -42.40 -66.55 >>> 8 CPUs in mask -0.03 -47.82 -68.39 >>> 16 CPUs in mask 0.12 -41.95 -58.26 >>> 32 CPUs in mask 0.02 -25.43 -39.35 >>> 64 CPUs in mask 0.00 -24.70 -37.83 >>> >>> With 1 thread (i.e. no contention), there is no regression in execution time. >>> With multiple threads, as expected there is a significant improvement in >>> execution time. >>> >>> As a more practical benchmark to simulate host evacuation, I measured the >>> memory dirtying rate across 10 VMs after enabling log dirty (on an AMD system, >>> so without PML). The rate increased by 16% with this patch series, even >>> after the recent deferred TLB flush changes. >> >> Is this a positive thing though? In the context of some related work something >> similar was mentioned iirc, accompanied by stating that this is actually >> problematic. A guest in log-dirty mode generally wants to be making progress, >> but also wants to be throttled enough to limit re-dirtying, such that >> subsequent iterations (in particular the final one) of page contents >> migration won't have to process overly many pages a 2nd time. > > In the context of a real migration, both the process copying the pages > out of the guest and the guest itself will be hitting the TLB flush lock > so reducing that bottleneck may increase throughput on both sides. > Whether or not the overall migration time increases or decreases depends > on many factors (number of migrations in parallel, the rate the guest is > dirtying memory, the line speed of the NIC, whether PML is used, ...) > which is why I measured a more controlled scenario to demonstrate the > change. > > IMO throttling of a guest during a migration should be something > intentional and controlled by userspace policy rather than a side effect > of some internal global locks. I definitely agree here, but side effects going away may make it necessary to add such explicit throttling. Jan