From mboxrd@z Thu Jan 1 00:00:00 1970 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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 448EEC433EF for ; Fri, 27 May 2022 11:28:25 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id BA8328D0005; Fri, 27 May 2022 07:28:24 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id B32918D0002; Fri, 27 May 2022 07:28:24 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id A1C428D0005; Fri, 27 May 2022 07:28:24 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id 93CE38D0002 for ; Fri, 27 May 2022 07:28:24 -0400 (EDT) Received: from smtpin20.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id 5812121370 for ; Fri, 27 May 2022 11:28:24 +0000 (UTC) X-FDA: 79511299728.20.B6C3A93 Received: from mail.skyhub.de (mail.skyhub.de [5.9.137.197]) by imf24.hostedemail.com (Postfix) with ESMTP id 756FE180039 for ; Fri, 27 May 2022 11:28:09 +0000 (UTC) Received: from zn.tnic (p200300ea97465727329c23fffea6a903.dip0.t-ipconnect.de [IPv6:2003:ea:9746:5727:329c:23ff:fea6:a903]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.skyhub.de (SuperMail on ZX Spectrum 128k) with ESMTPSA id 2F0791EC01A9; Fri, 27 May 2022 13:28:17 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alien8.de; s=dkim; t=1653650897; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:in-reply-to:in-reply-to: references:references; bh=HHppRTC40Y6+2eoncHCdfnKVWjko+FhCz1o03rYlyCc=; b=LN1EzsyvZ2sLeZ3Tl7ENuteHHNmcuWv36VyNiTfryuZdzWLnENO1x3VsZyF2yzDmk+eORo 8wo7BL3PqvrsmXPr0N8R47ZP468Q/DOrqx8umtU1amU2YB7vBUSR1AAfFewO4dVdwYOFia muMEHkcYg8YJpl6h72PghChaMEAxrEo= Date: Fri, 27 May 2022 13:28:12 +0200 From: Borislav Petkov To: Mark Hemment Cc: Linus Torvalds , Andrew Morton , the arch/x86 maintainers , Peter Zijlstra , Patrice CHOTARD , Mikulas Patocka , Lukas Czerner , Christoph Hellwig , "Darrick J. Wong" , Chuck Lever , Hugh Dickins , patches@lists.linux.dev, Linux-MM , mm-commits@vger.kernel.org, Mel Gorman Subject: Re: [PATCH] x86/clear_user: Make it faster Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: X-Rspamd-Server: rspam06 X-Rspamd-Queue-Id: 756FE180039 X-Stat-Signature: 6nwshdg5zn5rayfsn9ygd5t1ozk7hqh8 X-Rspam-User: Authentication-Results: imf24.hostedemail.com; dkim=pass header.d=alien8.de header.s=dkim header.b=LN1Ezsyv; spf=pass (imf24.hostedemail.com: domain of bp@alien8.de designates 5.9.137.197 as permitted sender) smtp.mailfrom=bp@alien8.de; dmarc=pass (policy=none) header.from=alien8.de X-HE-Tag: 1653650889-980837 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Wed, May 25, 2022 at 01:11:17PM +0100, Mark Hemment wrote: > A slight doubt here; comment says "less than a cachline", but the code > is using 'ja' (jump if above) - so calls 'clear_user_original' for a > 'len' less than or equal to 64. > Not sure of the intended behaviour for 64 bytes here, but > 'copy_user_enhanced_fast_string' uses the slow-method for lengths less > than 64. So, should this be coded as; > cmp $64,%rcx > jb clear_user_original > ? Yeah, it probably doesn't matter whether you clear a cacheline the "old" way or with some of the new ones. clear_user() performance matters only in microbenchmarks, as I've come to realize. But your suggestion simplifies the code so lemme do that. Thx! -- Regards/Gruss, Boris. https://people.kernel.org/tglx/notes-about-netiquette