Received: by 2002:a05:7412:b101:b0:e2:908c:2ebd with SMTP id az1csp3411612rdb; Thu, 16 Nov 2023 08:49:13 -0800 (PST) X-Google-Smtp-Source: AGHT+IEB0S9MjSMl3J6BPqA4FzxF6ydU+YdaMns8lAoI930kPXjtJEibRlFXm+0gS9Xu8ETNQ1fS X-Received: by 2002:a17:90b:4f8b:b0:280:892a:75ab with SMTP id qe11-20020a17090b4f8b00b00280892a75abmr3350252pjb.10.1700153352904; Thu, 16 Nov 2023 08:49:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700153352; cv=none; d=google.com; s=arc-20160816; b=dqTAXM3GK/vmFuJ93ult1Zh0gfL2C/KCKkv0KteDN7xDSAk872AcQgezH6PUcEyHpC /OA7Mx4QoxEUCNJ7Yt48kEdgUBVLlS+gHDycv8GvaN/SFCX9lXLAt7cTVbLlpn07qsbR 7dJJSk769GW8Ctzqn4CTVP/IOjjRJwedd3cP3oABaT3PNBCdr2y0ruimYNaS72DvyKvZ 0yuFz6J7/8y7VZc/K7HpL9Ks8bzWxHdWLAMsqZMs3CYzFJpwv9q3zlaF2eApHatZhUFA 4Tr2Gj3+Gfm5sY2FKZ5g9xIcYXaAUpya56iRPodlGjc49YfUFNMGEkW0K7HRMz7wPahy hceA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=UKTCm7ggbJLm3ZHcQ81iQju2vexC4L52XL08aMMC/TA=; fh=O4rNFgBXe7gL1Xb5T7LcphrOPlFXf4AvwUu3ZeHYo34=; b=wgunipTux0a3P5enusFwly2rl1bahbse8274jYGWQ1Uk8bo84ehTTB2hlI48NC+7xr tCebLn6F5KtHwB2ZXJEjR45oOpfb0To/iqw/ZQotFbU8UUxILw+254J3F9zNirBh2t98 rBYPvet5InRiYkc3idkG7IxOdXyrhZmtcEYNBrcx+RJB92DgzoVuKpQL4z2lR0/ZQjny VOnMNFScpj6w94GD837ejpdVr8OBcHjZ/RKNZe+1YsUAgoByeANqKEBeSONpZK9/Oj7p GSK1H9rK9Vd2dk/ZgPG6+ixaDU28s9OZ0pKXhSyHuFXP62oMwMrOsLkUmlvZvM0W4Lr4 EtQg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=O2scRUTB; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id mh9-20020a17090b4ac900b0027d0e78a0b3si2490224pjb.190.2023.11.16.08.48.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 16 Nov 2023 08:49:12 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=O2scRUTB; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id F150081DA398; Thu, 16 Nov 2023 08:48:47 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231305AbjKPQsq (ORCPT + 99 others); Thu, 16 Nov 2023 11:48:46 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35052 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231294AbjKPQsn (ORCPT ); Thu, 16 Nov 2023 11:48:43 -0500 Received: from mail-lf1-x12f.google.com (mail-lf1-x12f.google.com [IPv6:2a00:1450:4864:20::12f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 20B8CD68 for ; Thu, 16 Nov 2023 08:48:39 -0800 (PST) Received: by mail-lf1-x12f.google.com with SMTP id 2adb3069b0e04-50a6ff9881fso1525844e87.1 for ; Thu, 16 Nov 2023 08:48:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=google; t=1700153317; x=1700758117; darn=vger.kernel.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=UKTCm7ggbJLm3ZHcQ81iQju2vexC4L52XL08aMMC/TA=; b=O2scRUTBMQFAD9c0p80AES7z/RSreQtvMoIBUD1Po/8nf5B0ov/a1w2e1EdGmZgaCV fUlKzOra4FnpAmoPvYQr0+C+HMNh1YVmyrcONH/BNo7tIg0eSG7PzZOokq6T1I+390/+ k0wsdr6KGcF4x0kK+DPmgR/MCWOdT39wa0IZk= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700153317; x=1700758117; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=UKTCm7ggbJLm3ZHcQ81iQju2vexC4L52XL08aMMC/TA=; b=TGDwCZ4li8oEPJkbSr1jfBcAFUW6Yb8J+uuINYvH+35DkKeRYthKRehfXeVOGFmHJG U7AUHEnS6lJEUzjPaikP9N0OovRDP9x6qD9QgaokERcpk443glpIDTp2/QfKfZ2DCuet OoIyjUcoyfIf+O7IfOuRjfhwt45TgwozMrsVAQ5r2DXxx5OJsqooXrgcvZ6ZMDXwFaqM xPaHFBIe3NJ86KX+pQA0shMG699c0Is+AGzNAcJ1awK5smSLlHq85lL4bq/FXcbOJbMo 8UfC7OzTsLC8FV+UcsThkhGt4alLDe6IU0c+9GkQuCbQQYGqEDyRPwv0fR+1LE9vdGhC Qbfg== X-Gm-Message-State: AOJu0Yx6GqBPj1PeZ1oG4+WnFAVUmt1PRivspSSD6Cr+17RBvW8XoW3D oF49GBrxzKU5GtKHRpcHWZBC3ASIJb0J/QE0mtoMg4Qw X-Received: by 2002:a05:6512:4d1:b0:509:8eb6:6837 with SMTP id w17-20020a05651204d100b005098eb66837mr11613165lfq.47.1700153317139; Thu, 16 Nov 2023 08:48:37 -0800 (PST) Received: from mail-ed1-f53.google.com (mail-ed1-f53.google.com. [209.85.208.53]) by smtp.gmail.com with ESMTPSA id p11-20020a056402074b00b0053da3a9847csm7925925edy.42.2023.11.16.08.48.36 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 16 Nov 2023 08:48:36 -0800 (PST) Received: by mail-ed1-f53.google.com with SMTP id 4fb4d7f45d1cf-54366784377so1486361a12.3 for ; Thu, 16 Nov 2023 08:48:36 -0800 (PST) X-Received: by 2002:aa7:d510:0:b0:533:520:a5a8 with SMTP id y16-20020aa7d510000000b005330520a5a8mr12500577edq.29.1700153316001; Thu, 16 Nov 2023 08:48:36 -0800 (PST) MIME-Version: 1.0 References: <202311061616.cd495695-oliver.sang@intel.com> <3865842.1700061614@warthog.procyon.org.uk> <20231115190938.GGZVUXcuUjI3i1JRAB@fat_crate.local> <20231116154406.GDZVY4xmFvRQt0wGGE@fat_crate.local> In-Reply-To: <20231116154406.GDZVY4xmFvRQt0wGGE@fat_crate.local> From: Linus Torvalds Date: Thu, 16 Nov 2023 11:48:18 -0500 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [linus:master] [iov_iter] c9eec08bac: vm-scalability.throughput -16.9% regression To: Borislav Petkov Cc: David Howells , kernel test robot , oe-lkp@lists.linux.dev, lkp@intel.com, linux-kernel@vger.kernel.org, Christian Brauner , Alexander Viro , Jens Axboe , Christoph Hellwig , Christian Brauner , Matthew Wilcox , David Laight , ying.huang@intel.com, feng.tang@intel.com, fengwei.yin@intel.com Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-1.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE, URIBL_BLOCKED autolearn=no 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 X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Thu, 16 Nov 2023 08:48:48 -0800 (PST) On Thu, 16 Nov 2023 at 10:44, Borislav Petkov wrote: > > Reportedly and apparently, this pretty much addresses the issue at hand. > However, I'd still like for the compiler to handle the small length > cases by issuing plain MOVs instead of blindly doing "call memcpy". > > Lemme see how it would work with your patch... Hmm. I know about the '-mstringop-strategy' flag because of the fairly recently discussed bug where gcc would create a byte-by-byte copy in some crazy circumstances with the address space attributes: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111657 But I incorrectly thought that "-mstringop-strategy=libcall" would then *always* do library calls. So I decided to test, and that shows that gcc still ends up doing the "expand small constant size copies inline" even with that option, and doesn't force library calls for those cases. IOW, my assumption was just broken, and using "-mstringop-strategy=libcall" may well be the right thing to do. Of course, it's also possible that with all the function call overhead introduced by the CPU mitigations on older CPU's, we should just say "rep movsb" is always correct - if you have a new CPU with FSRM it's good, and if you have an old CPU it's no worse than the horrendous CPU mitigation overhead for function call/returns. I really hate the mitigations. Oh well. Ayway, maybe your patch is the RightThing(tm). Or maybe we should use 'rep_byte' instead of 'libcall'. Who knows.. Linus