From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail.skyhub.de (mail.skyhub.de [5.9.137.197]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6F7BA46BC for ; Fri, 27 May 2022 11:28:29 +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: Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: 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