Received: by 2002:a05:7412:b130:b0:e2:908c:2ebd with SMTP id az48csp464752rdb; Fri, 17 Nov 2023 04:10:32 -0800 (PST) X-Google-Smtp-Source: AGHT+IFvixZ+I2zkxnvSDk5M9BDs3qAgvUN+pemADYbqHuQG9Iirps1T6OTJz2CmFVoJejMLuqp8 X-Received: by 2002:a17:90b:314c:b0:280:72b:397d with SMTP id ip12-20020a17090b314c00b00280072b397dmr6840891pjb.20.1700223032239; Fri, 17 Nov 2023 04:10:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700223032; cv=none; d=google.com; s=arc-20160816; b=PUj3CZU/cbsDxXF1eQyHKBUWB0IMSJbFc0/ZIRqyu5gBwrt4cg8mOzqNICVHF0gk17 l1y3jZXJ9vsyUYhBxGyKEN9XdTJKGwAB3r0BzcxRxAJ3JG/2sHx8/8DpB0GdSGX6yOSA /yZuJdli3+43r1mrPqfSk4UQr+mC8/Z5OJL4wTKWz0XKmDgn4+FtDEK+lK1KW4oP+Hht RdB+QrnaJ7by30fSSpI+viSU5YYQ0ogwq3/JhiSoAu3BYwFkchuhE3o7QVuflnX9jymw bGK90J1yBUGJeWDnDWx/VI9UUkyppw7Z8DsATJFltcooR8YXP/9KSq3z1tgM8AG6+jyO ydAA== 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:reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=FxZeqSyzArBoXMRwOJE+Ura8EkE7wjC2PJj+X2FJmxE=; fh=DWHZqSW62Q5XSJTIN2jXUmcCV0VgeJKIWJ5L4YhQrgg=; b=kSSp4oeFR7tBwkuM41jsRMpmD2Rc4lQub6a639fEmpkOyyJDOMaDIQjE8vi+yiDOFN A4YT9lQysr77BmU3LF2RzhpNVd8Hog1q2nGYllXc0HNscYtE5MtNLNGxCGfnGMCO7epD LZMH2eGE0q9h3ELIvoUROJBaTfWV1Xp8HT0rWkbIBXDX2QnnjUa7N3sNtTz1L1wKV3N+ M0u5P1HdFU9b1KHyqhOoyF7Cc2i4aAURC6wAm92u1GMbomR+mdcZ4z8V9bOWdongCUsR O9OvIsj46FkjywLbFR5FF41/VgHe8koL/eLEX9dwvRUc3JO5zVyt+S/DegY/hkIZ3sqk hi4w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=CB07P2Jm; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from groat.vger.email (groat.vger.email. [23.128.96.35]) by mx.google.com with ESMTPS id nl9-20020a17090b384900b00282ecb475b6si1860239pjb.174.2023.11.17.04.10.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Nov 2023 04:10:32 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) client-ip=23.128.96.35; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=CB07P2Jm; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id 055F68304ECF; Fri, 17 Nov 2023 04:10:29 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345854AbjKQMKN (ORCPT + 99 others); Fri, 17 Nov 2023 07:10:13 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35074 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345745AbjKQMKM (ORCPT ); Fri, 17 Nov 2023 07:10:12 -0500 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6BDDE1A5 for ; Fri, 17 Nov 2023 04:10:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1700223008; h=from:from:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:in-reply-to:in-reply-to: references:references; bh=FxZeqSyzArBoXMRwOJE+Ura8EkE7wjC2PJj+X2FJmxE=; b=CB07P2JmlcnvRacqybQj6TRo4WsuZE2YnQFESC+52C8KFlxphHRW8qEB8CEbKhykmo0+U4 G+ppgQRSVUblCQeNnjfLN6uW9lcAvCZRE8e7Uqh6AuYtUSc3pnhXkq0VBARCtDJsa2PLn5 NTAhY+d9qkht0h8asKYknerM7ivQ15M= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-146-_-crp8HjN-a76gkW3SOucA-1; Fri, 17 Nov 2023 07:10:06 -0500 X-MC-Unique: _-crp8HjN-a76gkW3SOucA-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 88896101A53B; Fri, 17 Nov 2023 12:10:05 +0000 (UTC) Received: from tucnak.zalov.cz (unknown [10.39.194.53]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 031D1C1290F; Fri, 17 Nov 2023 12:10:04 +0000 (UTC) Received: from tucnak.zalov.cz (localhost [127.0.0.1]) by tucnak.zalov.cz (8.17.1/8.17.1) with ESMTPS id 3AHCA0F12487662 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Fri, 17 Nov 2023 13:10:00 +0100 Received: (from jakub@localhost) by tucnak.zalov.cz (8.17.1/8.17.1/Submit) id 3AHC9uis2485185; Fri, 17 Nov 2023 13:09:56 +0100 Date: Fri, 17 Nov 2023 13:09:55 +0100 From: Jakub Jelinek To: Borislav Petkov Cc: Linus Torvalds , 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, linux-toolchains ML Subject: Re: [linus:master] [iov_iter] c9eec08bac: vm-scalability.throughput -16.9% regression Message-ID: Reply-To: Jakub Jelinek References: <202311061616.cd495695-oliver.sang@intel.com> <3865842.1700061614@warthog.procyon.org.uk> <20231115190938.GGZVUXcuUjI3i1JRAB@fat_crate.local> <20231116154406.GDZVY4xmFvRQt0wGGE@fat_crate.local> <20231117114421.GCZVdSFZ7DKtBol821@fat_crate.local> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231117114421.GCZVdSFZ7DKtBol821@fat_crate.local> X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.8 X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.vger.email 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 (groat.vger.email [0.0.0.0]); Fri, 17 Nov 2023 04:10:29 -0800 (PST) On Fri, Nov 17, 2023 at 12:44:21PM +0100, Borislav Petkov wrote: > Might as well Cc toolchains... > > On Thu, Nov 16, 2023 at 11:48:18AM -0500, Linus Torvalds wrote: > > 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 > > I hear those stringop strategy heuristics are interesting. :) > > > But I incorrectly thought that "-mstringop-strategy=libcall" would > > then *always* do library calls. > > That's how I understood it too. BUT, reportedly, small and known sizes > are still optimized, which is exactly what we want. Sure. -mstringop-strategy affects only x86 expansion of the stringops from GIMPLE to RTL, while for small constant sizes some folding can happen far earlier in generic code. Similarly, the copy/store by pieces generic handling (straight-line code expansion of the builtins) is done in some cases without invoking the backend optabs which is the only expansion affected by the strategy. Note, the default strategy depends on the sizes, -mtune= in effect, whether it is -Os or -O2 etc. And the argument for -mmemcpy-strategy= or -mmemset-strategy= can include details on what sizes should be handled by which algorithm, not everything needs to be done the same. > > IOW, my assumption was just broken, and using > > "-mstringop-strategy=libcall" may well be the right thing to do. > > And here's where I'm wondering whether we should enable it for x86 only > or globally. I think globally because those stringop heuristics happen, > AFAIU, in the general optimization stage and thus target agnostic. -mstringop-strategy= option is x86 specific, so I don't see how you could enable it on other architectures. Anyway, if you are just trying to work-around bugs in specific compilers, please limit it to the affected compilers, overriding kernel makefiles forever with the workaround would mean you force perhaps suboptimal expansion in various cases. Jakub