From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id AE51A3858404; Mon, 20 Sep 2021 02:23:27 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org AE51A3858404 From: "goldstein.w.n at gmail dot com" To: glibc-bugs@sourceware.org Subject: [Bug string/28354] New: For x86_64 string/memory functions use of EVEX registers sets HI16_ZMM_state adding context switch overhead Date: Mon, 20 Sep 2021 02:23:27 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: glibc X-Bugzilla-Component: string X-Bugzilla-Version: 2.34 X-Bugzilla-Keywords: X-Bugzilla-Severity: minor X-Bugzilla-Who: goldstein.w.n at gmail dot com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at sourceware dot org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: glibc-bugs@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Glibc-bugs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 Sep 2021 02:23:27 -0000 https://sourceware.org/bugzilla/show_bug.cgi?id=3D28354 Bug ID: 28354 Summary: For x86_64 string/memory functions use of EVEX registers sets HI16_ZMM_state adding context switch overhead Product: glibc Version: 2.34 Status: UNCONFIRMED Severity: minor Priority: P2 Component: string Assignee: unassigned at sourceware dot org Reporter: goldstein.w.n at gmail dot com Target Milestone: --- Use of ymm16-ymm31 in the exex string/memory functions in sysdeps/x86_64/multtiarch sets HI16_ZMM_state to true. See: https://www.intel.com/content/dam/www/public/us/en/documents/manuals/64-ia-= 32-architectures-software-developer-vol-1-manual.pdf#page=3D321 This defeats the init optimization of various xsave* context switching instructions. Overall it adds at the very least 1024 bytes to context switc= hes. Simple reproduction: ``` .global _start .text _start: vpxorq %ymm16, %ymm16, %ymm16 vzeroupper loop: jmp loop movl $60, %eax xorl %edi, %edi syscall ``` Then check: cat /proc/${pid}/arch_status Which will show the state being continuously updated. State is updated during context switch here: https://elixir.bootlin.com/linux/v5.15-rc1/source/arch/x86/kernel/fpu/core.= c#L108) --=20 You are receiving this mail because: You are on the CC list for the bug.=