Received: by 2002:a05:7412:b101:b0:e2:908c:2ebd with SMTP id az1csp2816596rdb; Wed, 15 Nov 2023 11:16:24 -0800 (PST) X-Google-Smtp-Source: AGHT+IGAZy6oLYMlbwxHSaEgqhQ1ZXL43+SuAFaArfVFeFv5QPTdoMLCvMQmJtGDn1gFVQmbg2Ih X-Received: by 2002:a17:90b:1b10:b0:280:959d:1d10 with SMTP id nu16-20020a17090b1b1000b00280959d1d10mr11563472pjb.3.1700075783873; Wed, 15 Nov 2023 11:16:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700075783; cv=none; d=google.com; s=arc-20160816; b=sUoa1hhy9NwSuT1FaHCBhIWcsQ4qvvywryqnMbXnxTiChCNQtigZ5V2oX2nxLweh6p Tpq4UAZdTkitwKnM8obXrMyDPIwR1uYP+XSJHvWV1g8oJwyCe2vFSgyMGELmHgNRxoYj lPGhcSaH6e9b3QwRgiOSUXKao3YKJTTiQrAPmrJfB8fukFc0hS6fX5AhMJXZnDpLvg6b o4BYFJGUng4/8lE0w2hRd6Z9oY9kdFUSE7lBNLutnXUnSYLgJPibQYDYgS38pVYCe67/ zBSP3zMtfyTfrUVfODbwVfkcFH/Msb1PbG/t7XissCWV1Tp1j7IxOtNEkJxtRpAR6ygb K2Ww== 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=6ASZLC/ODVoT1N8Pjpom0HFAzc3MgwAYR1S4lEQGUD4=; fh=O4rNFgBXe7gL1Xb5T7LcphrOPlFXf4AvwUu3ZeHYo34=; b=ALBOIF5BPV2b+ELNygYWnOHK/SFhvlVq2plS0Vq0CpdkL8i88TbFU67E84oL52l62I fdRNt3ftTMcLebJAAgnSvWEdn/V2OBvP/GhzWYdY/GL0iAOLGoVkkKMmDjVahFRJ6tQ+ HRuu+JkHnxrvwy9X5neNMcb7phAIk3u/VE1pT1+cR4prO+jvlle/As2UC0w15WNFTu75 z5YCdPqS+ywoeK/lqGcDu0T1XHwJ6TxxLZkl1yIerTnJSQ2S4c/WflyttMRYbftXzZbe DJh1JsGQ4+GbEi5zGeXxqGmM0JlZaxPoqCjXpYoDuwA83OZMK38H596cx2W0O1nVn4K2 Hl9g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b="QV/S2q+o"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id mj17-20020a17090b369100b002803426321asi303043pjb.175.2023.11.15.11.16.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Nov 2023 11:16:23 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b="QV/S2q+o"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 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 C76E480AD8E7; Wed, 15 Nov 2023 11:16:11 -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 S230319AbjKOTQL (ORCPT + 99 others); Wed, 15 Nov 2023 14:16:11 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48880 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229575AbjKOTQJ (ORCPT ); Wed, 15 Nov 2023 14:16:09 -0500 Received: from mail-ed1-x531.google.com (mail-ed1-x531.google.com [IPv6:2a00:1450:4864:20::531]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0575719E for ; Wed, 15 Nov 2023 11:16:06 -0800 (PST) Received: by mail-ed1-x531.google.com with SMTP id 4fb4d7f45d1cf-53ed4688b9fso67116a12.0 for ; Wed, 15 Nov 2023 11:16:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=google; t=1700075764; x=1700680564; 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=6ASZLC/ODVoT1N8Pjpom0HFAzc3MgwAYR1S4lEQGUD4=; b=QV/S2q+otJeftflGUe656F5D89Cd2cGH1AvFgnenpatSk6TadPHAbEgiV/pdB1X4v/ NUEOywr4xSMgs05WmS/MLgNKd7Svt2rwfzs7ek1xjOMwzV4xak+1WvjiPSx0BvF/1yOQ Ec136mZPYjXx49dPZpZv9sct+rCej1MifkfcI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700075764; x=1700680564; 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=6ASZLC/ODVoT1N8Pjpom0HFAzc3MgwAYR1S4lEQGUD4=; b=mku2M+arIQVFS83iUJt5Ujr/o+ci15Gv3dioGjZuv6QA5wj9dACeb7Q48SOa3pxedd 7/qEVLq/o0nddD3S6wsrcStORlm4Z+SaiuDliaAOTM6CY+YrgDT4qc2wQEOSZ9aT+x1Y o3pchiQG5K719stNSTxt7lSqblmKgLGC2d8EafTQKgZQftjPWDx5AmN96hCXUDNjT2GZ 8bzJafIYQ+r4RvQ17J+ZPggMHJuoIFjwwD2PKGPMBVEBaGxv5UKpMoevKPPQaaRjNEXN N/01SgWrU8SUa04TS8b+bddxEkYNTxtIe5aIVT9wd7wTAnmGpTKcY13WOSjX/kzWDAYq TXtw== X-Gm-Message-State: AOJu0YwFmx8V33grzX4wBVUflIUFPaR093LSdGPKxs69yVkmnvFsI+cJ xtsSrZxQinkxQhegjsGWAM2cIBBkcz0CBpKtB7jJkv9O X-Received: by 2002:aa7:d059:0:b0:540:b0ec:bcc7 with SMTP id n25-20020aa7d059000000b00540b0ecbcc7mr217477edo.5.1700075764144; Wed, 15 Nov 2023 11:16:04 -0800 (PST) Received: from mail-ed1-f54.google.com (mail-ed1-f54.google.com. [209.85.208.54]) by smtp.gmail.com with ESMTPSA id z9-20020a50cd09000000b00543b2d6f88asm6941321edi.15.2023.11.15.11.16.03 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 15 Nov 2023 11:16:03 -0800 (PST) Received: by mail-ed1-f54.google.com with SMTP id 4fb4d7f45d1cf-5441ba3e53cso54078a12.1 for ; Wed, 15 Nov 2023 11:16:03 -0800 (PST) X-Received: by 2002:a05:6402:5193:b0:543:5789:4d6c with SMTP id q19-20020a056402519300b0054357894d6cmr292256edd.2.1700075763431; Wed, 15 Nov 2023 11:16:03 -0800 (PST) MIME-Version: 1.0 References: <202311061616.cd495695-oliver.sang@intel.com> <3865842.1700061614@warthog.procyon.org.uk> <20231115190938.GGZVUXcuUjI3i1JRAB@fat_crate.local> In-Reply-To: <20231115190938.GGZVUXcuUjI3i1JRAB@fat_crate.local> From: Linus Torvalds Date: Wed, 15 Nov 2023 14:15:46 -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_BLOCKED,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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]); Wed, 15 Nov 2023 11:16:11 -0800 (PST) On Wed, 15 Nov 2023 at 14:10, Borislav Petkov wrote: > > Should we define an alternative_memcpy() which is used *only* during > rewriting so that this becomes a non-issue? Yeah, I think the instruction rewriting should use something that explicitly cannot possibility itself need rewriting, and a plain 'memcpy()' is obviously that. The good news is that at least things like structure copies would *not* trigger that alternative, so it's only explicit memcpy() calls that my patch changes. But I would not be surprised if instruction rewriting does that. I didn't actually check. > Yours looks simple enough and makes sense. Lemme poke at it a bit in the > coming days and see what happens. Note that it has a nasty interaction with fortify-source, which is why it has that hacky "#undef memcpy" in that unrelated header. Also note that I was being very very lazy in how I re-used the "rep_movs_alternative" function that we already have. And it's actually a bad laziness, because our existing rep_movs_alternative does the exception handling for user mode faults. We don't actually want exception handling for 'memcpy()', because it could hide bugs. If a memcpy() gets a bad pointer, we want the oops, not a partial copy. So my patch really is broken. It might happen to work when everything else goes right, and it's small, but it is very much a "proof of concept" rather than something that is actually acceptable. Linus