Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp325333pxu; Thu, 15 Oct 2020 05:06:43 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzPf7K1s5H2VZ5i5hjgSNUWxMEdD5lFAEvrimWy7yDjJxBLU044MOSXZ8+CHhTU+cv+m7G2 X-Received: by 2002:a19:c786:: with SMTP id x128mr890469lff.478.1602763603138; Thu, 15 Oct 2020 05:06:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1602763603; cv=none; d=google.com; s=arc-20160816; b=u1KGKaefhfDl+Y4DRdKi602TM6lQxkTHrzYK5pMjkHSe5uayrXLu0rEfYpgHkX8z5t sgaoXwuLs3eSkiBZ8Gx9r/C+BEbBSM3wSxj1zqYD4i11jq9SFf++BwicxsN8aUhplioy rh/R3J9dQAVXWr2oZNTaTDFGtgiG2zg9dnyOdaZqyrAEF5iIgIur1YjMRDaMOfeCBdS4 1qCpXroW0CC8D9ngm17yubK5JDJ+nlb+CByH23o0T5nH+PTi9HdZj+xtbKixxLptuDf2 aclzajBtc6WZctq/puD3PzGDDzCbQOuJm0x5/o4ny3s+YS7t4H4q5ySN3kXW5EiF6Qem vy+Q== 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:message-id:subject:cc:to:from:date:dkim-signature; bh=Abf5zJCUocMG84tO1Pd+Xb6Qhr0rk+bSHfEj4Vlqxd4=; b=lUfEkhzMFj1fwsYGPulgnYJUBjCArlG/CrLugyJkxb4+DsMKEx5vKF6T/gY7GdBcZt pVslrt0YFuHp8n7M2Dpl5PwwTFsvppogUtSy/uGGZ2Ld70N0IO6xHCZMxYA9m3KQ76Wi tirDYt5ylK0ZkhEqLNGfrB+1+PiO0P0/oWLqq0HVSL9XA4UTmO3Tgh5ta4tPUp27p3H6 b1uYMvogiu/TucaGLdnAm0h9LzZSwntY76wxL9/tPfpCUW0ID94T8b1ndxd9TevW0evh VHybfU9OfSUc86ZoqSyFufDNInY0CvLrC1eU64BP+13FdNLhwhot/0wTm1QoIF8ef7QW If/Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@alien8.de header.s=dkim header.b=F3WHwom+; 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 o18si1925530ejx.472.2020.10.15.05.06.14; Thu, 15 Oct 2020 05:06:43 -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=F3WHwom+; 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 S1727440AbgJOKkx (ORCPT + 99 others); Thu, 15 Oct 2020 06:40:53 -0400 Received: from mail.skyhub.de ([5.9.137.197]:39430 "EHLO mail.skyhub.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726121AbgJOKkx (ORCPT ); Thu, 15 Oct 2020 06:40:53 -0400 Received: from zn.tnic (p200300ec2f0ed200d49a97be428f152e.dip0.t-ipconnect.de [IPv6:2003:ec:2f0e:d200:d49a:97be:428f:152e]) (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 D0AC91EC0380; Thu, 15 Oct 2020 12:40:51 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alien8.de; s=dkim; t=1602758451; 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=Abf5zJCUocMG84tO1Pd+Xb6Qhr0rk+bSHfEj4Vlqxd4=; b=F3WHwom+f2AaCQnFVubyh6NXdgmTO8cBPfzN1CVoIwCgUutY6WNq8U99A80sZxKZuBsXfF 2BGYherJ7zeV3DmaxFdR/ctcCjCf1EDr+5/7BK51je/nHraVR2/KHL9iWnH9jnMbN77iA+ Q2cMrVCV0giQg0NYucq/KUbUIRSASeY= Date: Thu, 15 Oct 2020 12:40:47 +0200 From: Borislav Petkov To: Ankur Arora Cc: Andy Lutomirski , Andy Lutomirski , 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: <20201015104047.GD11838@zn.tnic> References: <20201014195823.GC18196@zn.tnic> <22E29783-F1F5-43DA-B35F-D75FB247475D@amacapital.net> <50286c32-2869-cbd5-b178-0ad0c13584ea@oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <50286c32-2869-cbd5-b178-0ad0c13584ea@oracle.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Oct 14, 2020 at 08:21:57PM -0700, Ankur Arora wrote: > Also, if we did extend clear_page() to take the page-size as parameter > we still might not have enough information (ex. a 4K or a 2MB page that > clear_page() sees could be part of a GUP of a much larger extent) to > decide whether to go uncached or not. clear_page* assumes 4K. All of the lowlevel asm variants do. So adding the size there won't bring you a whole lot. So you'd need to devise this whole thing differently. Perhaps have a clear_pages() helper which decides based on size what to do: uncached clearing or the clear_page() as is now in a loop. Looking at the callsites would give you a better idea I'd say. Thx. -- Regards/Gruss, Boris. https://people.kernel.org/tglx/notes-about-netiquette