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=-5.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,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 4AF67C433E0 for ; Tue, 23 Feb 2021 01:42:59 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 9BDD964DDA for ; Tue, 23 Feb 2021 01:42:58 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9BDD964DDA Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=linux-foundation.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 17D116B0005; Mon, 22 Feb 2021 20:42:58 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 12FB56B0006; Mon, 22 Feb 2021 20:42:58 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 0440E6B006E; Mon, 22 Feb 2021 20:42:57 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0168.hostedemail.com [216.40.44.168]) by kanga.kvack.org (Postfix) with ESMTP id E29D46B0005 for ; Mon, 22 Feb 2021 20:42:57 -0500 (EST) Received: from smtpin09.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id B2878841A for ; Tue, 23 Feb 2021 01:42:57 +0000 (UTC) X-FDA: 77847833994.09.EFF0F77 Received: from mail-lf1-f51.google.com (mail-lf1-f51.google.com [209.85.167.51]) by imf08.hostedemail.com (Postfix) with ESMTP id F107380192C7 for ; Tue, 23 Feb 2021 01:42:46 +0000 (UTC) Received: by mail-lf1-f51.google.com with SMTP id u4so8952031lfs.0 for ; Mon, 22 Feb 2021 17:42:56 -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=RDooO6fVmEytrmsO+OdxP0t5z+1dW14dWuhPYDbhrNw=; b=TOQ2+I+mHXr+E4ckMqzQngYTWUZIiJAMZ4kPqTle0k554YS65ZycN+V9HItvfQ50zr EZoT+MbgL+/zfMBRgcqu5UVoaIVwhD+SMKXUFtegjKSZY4TW2k7+/++d/M+F9xtNPSR4 QNS7Z4Yl0m5J+4tzYKAjfLF5jYN/rQ/3C6zUg= 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=RDooO6fVmEytrmsO+OdxP0t5z+1dW14dWuhPYDbhrNw=; b=N1CNI+g8Yfdw/mEFCb9OmFOjzq7QmsLupmTSVIoW+XdsDKykGeVJAyqaFb6oFy1hs8 qg00ANJPixcABy/zLkJbDjGDgBBpG8Co2vvspRE06iHwZzVSscUsP1oyBktaAUD0OQIo qAuEBTG+oMUSk4OKHHdNg3X7bTo0M39Z0ivlUiqLZ4lpGc+1kxwBkbUg8VvNiHrenMDW cDo1tefJ5QY5MIvnH0kY4x8r6D1QwQVcnuNU/sZNMn223gpQO87Ed5Z3eln2sA4e1Uu3 vUvPFg9Qrop/or2PuLxofTzcDWQrot3h1mwU2gHL1RyjdFW0cUYnzIkawBRchEQdPkF2 MsnQ== X-Gm-Message-State: AOAM532pjY6DNS/iLq/GEltfndt77DaHa1dnfnOSgpm+3poPrvGZ7tml Pv2EMipEq3mCSEB6R9iFDV9X1LoA3KXU1g== X-Google-Smtp-Source: ABdhPJwrpaZKd/h7AJzlaWQwHT689q7aLvRLxq0xPLfRnG3T16cQYSarI0cvvg7T9wN3iYI6MOpfnw== X-Received: by 2002:a19:613:: with SMTP id 19mr14982678lfg.147.1614044575210; Mon, 22 Feb 2021 17:42:55 -0800 (PST) Received: from mail-lf1-f46.google.com (mail-lf1-f46.google.com. [209.85.167.46]) by smtp.gmail.com with ESMTPSA id g1sm2243477lfu.152.2021.02.22.17.42.54 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 22 Feb 2021 17:42:54 -0800 (PST) Received: by mail-lf1-f46.google.com with SMTP id j19so8744929lfr.12 for ; Mon, 22 Feb 2021 17:42:54 -0800 (PST) X-Received: by 2002:a19:6916:: with SMTP id e22mr14384009lfc.421.1614044573962; Mon, 22 Feb 2021 17:42:53 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Linus Torvalds Date: Mon, 22 Feb 2021 17:42:38 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PULL] fixes around VM_PFNMAP and follow_pfn for 5.12 merge window To: Daniel Vetter Cc: Linux Kernel Mailing List , dri-devel , Linux MM , "open list:DMA BUFFER SHARING FRAMEWORK" , Linux PCI Content-Type: text/plain; charset="UTF-8" X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: F107380192C7 X-Stat-Signature: 55z7h51qxzeuxetcs1facjd81mp7fpge Received-SPF: none (linuxfoundation.org>: No applicable sender policy available) receiver=imf08; identity=mailfrom; envelope-from=""; helo=mail-lf1-f51.google.com; client-ip=209.85.167.51 X-HE-DKIM-Result: pass/pass X-HE-Tag: 1614044566-931859 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 Mon, Feb 22, 2021 at 2:25 AM Daniel Vetter wrote: > > Cc all the mailing lists ... my usual script crashed and I had to > hand-roll the email and screwed it up ofc :-/ Oh, and my reply thus also became just a reply to you personally. So repeating it here, in case somebody has comments about that access_process_vm() issue. On Mon, Feb 22, 2021 at 2:23 AM Daniel Vetter wrote: > > I've stumbled over this for my own learning and then realized there's a > bunch of races around VM_PFNMAP mappings vs follow pfn. > > If you're happy with this [..] Happy? No. But it seems an improvement. I did react to some of this: commit 0fb1b1ed7dd9 ("/dev/mem: Only set filp->f_mapping") talks about _what_ it does, but not so much _why_ it does it. It doesn't seem to actually matter, and seems almost incidental (because you've looked at f_mapping and i_mapping just didn't matter but was adjacent. And generic_access_phys() remains horrific. Does anything actually use this outside of the odd magical access_remote_vm() code? I'm wondering if that code shouldn't just be removed entirely. It's quite old, I'm not sure it's really relevant. See commit 28b2ee20c7cb ("access_process_vm device memory infrastructure"). I guess you do debug the X server, but still.. Do you actually ever look at device memory through the debugger? I'd hope that you'd use an access function and make gdb call it in the context of the debuggee? Whatever. I've pulled it, and I'm not _unhappy_ with it, but I'd also not call myself overly giddy and over the moon happy about this code. Linus