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=-2.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS 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 99BD4C433DB for ; Wed, 27 Jan 2021 23:44:24 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 38BA264D7F for ; Wed, 27 Jan 2021 23:44:24 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 38BA264D7F Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id A27356B0005; Wed, 27 Jan 2021 18:44:23 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 9D8F16B006C; Wed, 27 Jan 2021 18:44:23 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 8EE516B006E; Wed, 27 Jan 2021 18:44:23 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0211.hostedemail.com [216.40.44.211]) by kanga.kvack.org (Postfix) with ESMTP id 7AB656B0005 for ; Wed, 27 Jan 2021 18:44:23 -0500 (EST) Received: from smtpin16.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 438C6180AD807 for ; Wed, 27 Jan 2021 23:44:23 +0000 (UTC) X-FDA: 77753186406.16.doll90_20129d32759b Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin16.hostedemail.com (Postfix) with ESMTP id 0FFC1100E690B for ; Wed, 27 Jan 2021 23:44:23 +0000 (UTC) X-HE-Tag: doll90_20129d32759b X-Filterd-Recvd-Size: 4049 Received: from mail-pj1-f50.google.com (mail-pj1-f50.google.com [209.85.216.50]) by imf17.hostedemail.com (Postfix) with ESMTP for ; Wed, 27 Jan 2021 23:44:22 +0000 (UTC) Received: by mail-pj1-f50.google.com with SMTP id s24so2468544pjp.5 for ; Wed, 27 Jan 2021 15:44:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:subject:to:cc:references:in-reply-to:mime-version :message-id:content-transfer-encoding; bh=Mxms3zmarGgtqLSA2knr9DFUQbJNpMaXiC1Rwt/vXfQ=; b=Rk78kGbTRTMsJht7TyBKfA+4NY6T9q1+B9xyRJPxErypmxzfFg1Nv607eX/zhWOilm xIF2iZKJNNs0OizLmf5xQchxGNztXdG+MejWZt4vq9jUdoGE3p13+Ow2gj+UnyxxLMZh 820dcly26qnDHkf+TMfpinOCa5mKEnv3EoTWeuKmPOAvBVp5douEF2TFDaFVJX8O7Aqa LcCdL+M1mXHI1pP2L6BrJGNIOAtJvb/1syYMNQ758u8UN2y9var1hizA1oYqPNmZo61S 0CFz4y8J5l+Bepx+5SfQ3rwd+HCH5CXiUK0kK8LHvswJ70Tr3B7u0ognkccOZsO5ruRp /QEw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:subject:to:cc:references:in-reply-to :mime-version:message-id:content-transfer-encoding; bh=Mxms3zmarGgtqLSA2knr9DFUQbJNpMaXiC1Rwt/vXfQ=; b=eTp6ZFN70Hi0duee9MY4mnvJVXZs/JzAnkWNgxUcokvAwk9XILWC6moFUZi0TZ4Yln c4UNp8HkCttxYmuVyS7C2lsqqRNhdAiu7eXatTTHJRrgMaHPGRgKTC6ipk24yika9+iU qUgluyh9Z4MsMlqizoUz//GLZNcMz75CLY3kSwNtk8AqJWYuJTq8ixxKh6vOxLV+aWly 8rKCCRuQIs9y6ljU1wTumSryqsjDHdFi5buvG6yDg7GNl2RA+igCt/ov1hoslVIxnbct pi6UYgUVOn5SSGcI6WwQ+Fa9n5YBizHS7OSuPW/ir26RZbfC3xDNeWSrt4kcYjgQ7+SK AUGA== X-Gm-Message-State: AOAM533ih8xhGRaqv+jO+ZIzEgLv8pT9glt6yo4aRjiikWSCI4wiCeIZ LPi4bXRhgehImNpsE8tM0Oc= X-Google-Smtp-Source: ABdhPJy973JY/GinSGJtf5a+0PiKQqWLhevqbbKoXQxFTvmud+BGNyTfcj6DSK6CkRQf8lc4vFUuNw== X-Received: by 2002:a17:90b:1004:: with SMTP id gm4mr8190388pjb.97.1611791061723; Wed, 27 Jan 2021 15:44:21 -0800 (PST) Received: from localhost (192.156.221.203.dial.dynamic.acc50-nort-cbr.comindico.com.au. [203.221.156.192]) by smtp.gmail.com with ESMTPSA id r14sm3828769pgi.27.2021.01.27.15.44.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Jan 2021 15:44:21 -0800 (PST) Date: Thu, 28 Jan 2021 09:44:15 +1000 From: Nicholas Piggin Subject: Re: [PATCH 2/5] kernel/dma: remove unnecessary unmap_kernel_range To: Christoph Hellwig , Konrad Rzeszutek Wilk Cc: Andrew Morton , iommu@lists.linux-foundation.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, Robin Murphy References: <20210126045404.2492588-1-npiggin@gmail.com> <20210126045404.2492588-3-npiggin@gmail.com> <20210127071059.GA21133@lst.de> In-Reply-To: <20210127071059.GA21133@lst.de> MIME-Version: 1.0 Message-Id: <1611790740.civn6atbwp.astroid@bobo.none> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable 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: Excerpts from Christoph Hellwig's message of January 27, 2021 5:10 pm: > On Tue, Jan 26, 2021 at 05:08:46PM -0500, Konrad Rzeszutek Wilk wrote: >> On Tue, Jan 26, 2021 at 02:54:01PM +1000, Nicholas Piggin wrote: >> > vunmap will remove ptes. >>=20 >> Should there be some ASSERT after the vunmap to make sure that is the >> case?=20 >=20 > Not really. removing the PTEs is the whole point of vunmap. Everything > else is just house keeping. Agree. I did double check this and wrote a quick test to check ptes were=20 there before the vunmap and cleared after, just to make sure I didn't=20 make a silly mistake with the patch. But in general drivers should be=20 able to trust code behind the API call will do the right thing. Such=20 assertions should go in the vunmap() implementation as appropriate. Thanks, Nick