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 X-Spam-Level: X-Spam-Status: No, score=-3.5 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D5D5CC388F7 for ; Tue, 3 Nov 2020 17:53:52 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 69FD522226 for ; Tue, 3 Nov 2020 17:53:52 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=linux-foundation.org header.i=@linux-foundation.org header.b="HlBdVjW4" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 69FD522226 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=linux-foundation.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id C3FA76E8DA; Tue, 3 Nov 2020 17:53:51 +0000 (UTC) Received: from mail-lf1-x144.google.com (mail-lf1-x144.google.com [IPv6:2a00:1450:4864:20::144]) by gabe.freedesktop.org (Postfix) with ESMTPS id 4790C6E8DA for ; Tue, 3 Nov 2020 17:53:50 +0000 (UTC) Received: by mail-lf1-x144.google.com with SMTP id e27so530162lfn.7 for ; Tue, 03 Nov 2020 09:53:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=o0HUqTtrB0uneYNpLQNhQJ6FusME7LjWI9KZLqRyy8M=; b=HlBdVjW42hUSJkakIiVHCgxY07l6tlPx/MKTOg49MQqEt9fKpSl2tO6bNlSfEMf3/D yOb2ZUXxHpDZzPlQCZuCKgGgj4iIodCB3C8y4WCLAE53N4IY/fO4MumxqPXGllxVBzjJ AuMTxQdvsElAjMkZERbVlQwjny9JwixE30+4I= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=o0HUqTtrB0uneYNpLQNhQJ6FusME7LjWI9KZLqRyy8M=; b=Xrj++sGhZTx9+2/EAbOsrMDvaMWb6bC6Oj8MJDvemPP/p0AWsM/Dzp8STgO9esNaWx eyif3pzibnUKXxSEXj/nFlK2frvGYBisEvaAjckwh+AKeNdN+dHFZZR0DRZEXOf9DYBS kgZjphaxDX/SXbyayhcE+qrQdST0UmFasuMR0qdk+JNTtMIiecHBaGMyobCwip4Rzqlj OtsFm2QqaqZbPw2sDL+3gSxQEknH7dtHvovtjRe8/AdBA8qT4ISZlUS+GzGqUBr5dsuF LALjK84iXE3f156Fk+ZTzSnRjW6zioLVFzRrGpbb8iYtRxl6QeFIjP9jiZzvibGrk0OJ y47A== X-Gm-Message-State: AOAM531b8xuqsgTyGEal+GN7CELeumzdVChnNNdgLrWCOGWl1wNgL7oA sq6N4KcvVtq2ykFGT6VaYDMRAMleK5p+dg== X-Google-Smtp-Source: ABdhPJysiwZNfyOScjbqtHIhfdqf/4o+Qtdo820CapTu2keuZaLJWKJOq8FmFnR7k/jQX+ees5JK6Q== X-Received: by 2002:ac2:5938:: with SMTP id v24mr7479971lfi.228.1604426028305; Tue, 03 Nov 2020 09:53:48 -0800 (PST) Received: from mail-lj1-f174.google.com (mail-lj1-f174.google.com. [209.85.208.174]) by smtp.gmail.com with ESMTPSA id 5sm4565113lju.25.2020.11.03.09.53.47 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 03 Nov 2020 09:53:48 -0800 (PST) Received: by mail-lj1-f174.google.com with SMTP id o13so11711109ljj.11 for ; Tue, 03 Nov 2020 09:53:47 -0800 (PST) X-Received: by 2002:a19:4815:: with SMTP id v21mr8859386lfa.603.1604425706752; Tue, 03 Nov 2020 09:48:26 -0800 (PST) MIME-Version: 1.0 References: <20201103092712.714480842@linutronix.de> <20201103095858.827582066@linutronix.de> In-Reply-To: <20201103095858.827582066@linutronix.de> From: Linus Torvalds Date: Tue, 3 Nov 2020 09:48:10 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [patch V3 22/37] highmem: High implementation details and document API To: Thomas Gleixner X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Juri Lelli , linux-aio@kvack.org, Peter Zijlstra , Sebastian Andrzej Siewior , dri-devel , linux-mips@vger.kernel.org, Ben Segall , Chris Mason , Huang Rui , Paul Mackerras , Gerd Hoffmann , Daniel Bristot de Oliveira , linux-sparc , Vincent Chen , Christoph Hellwig , Vincent Guittot , Paul McKenney , Max Filippov , Michael Ellerman , the arch/x86 maintainers , Russell King , linux-csky@vger.kernel.org, Ingo Molnar , David Airlie , VMware Graphics , Mel Gorman , nouveau@lists.freedesktop.org, Dave Airlie , "open list:SYNOPSYS ARC ARCHITECTURE" , Ben Skeggs , linux-xtensa@linux-xtensa.org, Arnd Bergmann , intel-gfx , Roland Scheidegger , Josef Bacik , Steven Rostedt , Rodrigo Vivi , Alexander Viro , spice-devel@lists.freedesktop.org, David Sterba , virtualization@lists.linux-foundation.org, Dietmar Eggemann , Linux ARM , Chris Zankel , Michal Simek , Thomas Bogendoerfer , Nick Hu , Linux-MM , Vineet Gupta , LKML , Christian Koenig , Benjamin LaHaise , linux-fsdevel , Andrew Morton , linuxppc-dev , "David S. Miller" , linux-btrfs , Greentime Hu Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" On Tue, Nov 3, 2020 at 2:33 AM Thomas Gleixner wrote: > > +static inline void *kmap(struct page *page) > +{ > + void *addr; > + > + might_sleep(); > + if (!PageHighMem(page)) > + addr = page_address(page); > + else > + addr = kmap_high(page); > + kmap_flush_tlb((unsigned long)addr); > + return addr; > +} > + > +static inline void kunmap(struct page *page) > +{ > + might_sleep(); > + if (!PageHighMem(page)) > + return; > + kunmap_high(page); > +} I have no complaints about the patch, but it strikes me that if people want to actually have much better debug coverage, this is where it should be (I like the "every other address" thing too, don't get me wrong). In particular, instead of these PageHighMem(page) tests, I think something like this would be better: #ifdef CONFIG_DEBUG_HIGHMEM #define page_use_kmap(page) ((page),1) #else #define page_use_kmap(page) PageHighMem(page) #endif adn then replace those "if (!PageHighMem(page))" tests with "if (!page_use_kmap())" instead. IOW, in debug mode, it would _always_ remap the page, whether it's highmem or not. That would really stress the highmem code and find any fragilities. No? Anyway, this is all sepatrate from the series, which still looks fine to me. Just a reaction to seeing the patch, and Thomas' earlier mention that the highmem debugging doesn't actually do much. Linus _______________________________________________ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel