Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp34760pxu; Wed, 14 Oct 2020 19:19:25 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxxYGgTg7k57uQgJumUKjQc1TMJniCH0Hm+DMWd2SyVWo5RqeiUNnbln0zsjU7IsU6ZHUjp X-Received: by 2002:a17:906:eb59:: with SMTP id mc25mr2102010ejb.34.1602728364815; Wed, 14 Oct 2020 19:19:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1602728364; cv=none; d=google.com; s=arc-20160816; b=jsCCb1DkGPoC+kdgO18UoDT9jsrgcT1g5+1h3poQP7OjdOAKXmpepN7/B9C9Vf9mrt uq6ibquNna6BRNSdsmb5jpROwtQbTAZylflVlaxMGYRMOemgQWv14w9BQaSu2cKhO2L9 lx98LTTtJrKTVyQnunLlq+2p9aP+n3c87t77TxFRM0E3bA/7a/ecEtKVxtrR1h6DaX/L Pj6CmOwuMLLCOQAq7AHfzNtz8CsRbPvbEqN+7Tu9vxHfSx6SMUnNMZhLGSS7199sg7Yw RBNpc+MCH7rgHTa4BaIc5y8hgpY/Q22aqhIUqA5WlpgtDaBW80alooSt7uzWT8P/RQuM sMFQ== 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-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=n2EEh9T4loDsc3k0fpJFPs2bQyJ8KCqgdH0vrYdkYXE=; b=eC1suwqD7cfCxzdhpjvIWrFpfaGan9QDBcTblrkt7l3p7rAB5fXSuRyxnAVZiMNo49 z4XjjK+C5tqe6SwauQefluj57zkYi3IsC5MfLcprZuurOv+tM/EejODgc63Y+Ez6TA0U cZsh/OG8wy/ZETjT9Z4Nx5ck7Lm5J4I1ziD344O/dej+GN6FajZneRAXMUjAvB1y7yqG sPlLAGpLDsCkXwOmuy22CJy5Vo5LEApwzbUIkz7OYfaMuztIXhKq8DCOmwq02lTu+Irl eqnEXbAxmwMzHdSKIlFSlJU3oSQBnSlvjWlpmaY5/H0O7j3C4PirWM8I5Zatdv4Yc/RS tPXQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@alien8.de header.s=dkim header.b=ooooy8z0; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=alien8.de Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id l23si1374402ejb.488.2020.10.14.19.19.02; Wed, 14 Oct 2020 19:19:24 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@alien8.de header.s=dkim header.b=ooooy8z0; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=alien8.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729611AbgJNVMY (ORCPT + 99 others); Wed, 14 Oct 2020 17:12:24 -0400 Received: from mail.skyhub.de ([5.9.137.197]:39550 "EHLO mail.skyhub.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726575AbgJNVMY (ORCPT ); Wed, 14 Oct 2020 17:12:24 -0400 Received: from zn.tnic (p200300ec2f0c4400e816bcc7a66b170f.dip0.t-ipconnect.de [IPv6:2003:ec:2f0c:4400:e816:bcc7:a66b:170f]) (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 8FC491EC026E; Wed, 14 Oct 2020 23:12:22 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alien8.de; s=dkim; t=1602709942; 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:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=n2EEh9T4loDsc3k0fpJFPs2bQyJ8KCqgdH0vrYdkYXE=; b=ooooy8z0oo+7/MV/pYkQOKvxejlWueeJ5rMNIb/HNMCUdEQduuW3bPBVgB6pLLxFD+6Hto 3FSyicn4jrjY2TBWpUhiB8bSYHLEvoWsdnovlPKO820Mi9JUKth3F/w+NXoa5HqXzsOSoM IRbWLoNUiHIkyE40VZUh1z7JVwbwwYQ= Date: Wed, 14 Oct 2020 23:12:14 +0200 From: Borislav Petkov To: Andy Lutomirski Cc: Andy Lutomirski , Ankur Arora , LKML , Linux-MM , "Kirill A. Shutemov" , Michal Hocko , Boris Ostrovsky , Konrad Rzeszutek Wilk , Thomas Gleixner , Ingo Molnar , X86 ML , "H. Peter Anvin" , Arnd Bergmann , Andrew Morton , Ira Weiny , linux-arch Subject: Re: [PATCH 5/8] x86/clear_page: add clear_page_uncached() Message-ID: <20201014211214.GD18196@zn.tnic> References: <20201014195823.GC18196@zn.tnic> <22E29783-F1F5-43DA-B35F-D75FB247475D@amacapital.net> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <22E29783-F1F5-43DA-B35F-D75FB247475D@amacapital.net> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Oct 14, 2020 at 02:07:30PM -0700, Andy Lutomirski wrote: > I assume it’s for a little optimization of clearing more than one > page per SFENCE. > > In any event, based on the benchmark data upthread, we only want to do > NT clears when they’re rather large, so this shouldn’t be just an > alternative. I assume this is because a page or two will fit in cache > and, for most uses that allocate zeroed pages, we prefer cache-hot > pages. When clearing 1G, on the other hand, cache-hot is impossible > and we prefer the improved bandwidth and less cache trashing of NT > clears. Yeah, use case makes sense but people won't know what to use. At the time I was experimenting with this crap, I remember Linus saying that that selection should be made based on the size of the area cleared, so users should not have to know the difference. Which perhaps is the only sane use case I see for this. > Perhaps SFENCE is so fast that this is a silly optimization, though, > and we don’t lose anything measurable by SFENCEing once per page. Yes, I'd like to see real use cases showing improvement from this, not just microbenchmarks. -- Regards/Gruss, Boris. https://people.kernel.org/tglx/notes-about-netiquette