Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp2162227pxb; Sat, 7 Nov 2020 11:22:36 -0800 (PST) X-Google-Smtp-Source: ABdhPJxuHbtXOYpxI3ZykkYRX9ZqMjNXv2PkUnVy4SdThuOgj9EyaVuONSvisuQiH7Y52WVn8zyD X-Received: by 2002:a17:906:c0c9:: with SMTP id bn9mr7828085ejb.289.1604776956375; Sat, 07 Nov 2020 11:22:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1604776956; cv=none; d=google.com; s=arc-20160816; b=jpT4YNPP/zqSilCzWxcfLmDAJgyKLU20PnzeO36LTegm3XK5MvZGTpINfumLxOB2yt thdwugRv10hMZgRliCCNuVKih/iAosQljBk5UCD1c8dDe++ouFh9UCgtg298CcJthSD0 N1e3gmISYPyVo2ac6E9XLuroVH/zO1yJ3gGkFP5yAsVU2juAoR8gnMAZdL2IKj342aI/ caVi7spdczU+YIleakhdeJ6/EBZ6beWG0yeF3ylt4KiHblWQmzR/fxDT04w/hjf8C/DH BGK/zEaW5jz+Y6bVOk8JlWGGsnJG1FvTVSXTLIV9wwYj7v02wILahL03LLEVlz+n+gYq 1gdQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:dkim-signature:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:references:cc:to:from:subject; bh=yfhdGpRJZc3CvodI5i1IHo+KRBmzHgvXgzVSoUCFcYw=; b=iU1alirBlhZZSVm+LpaaQUDsLC9NDK1KimVq0wEBVFAU1M4nVtlmAVWihIEXJjKbMg xcXxRIfFR85lT9X/u8ZkcaEQlZYsf3W01zgGLkmQ/xxHQKPi3D3pxMiGya45YZTmU6jy TvCxd1PgvJgRIRm0PekrWMMCVczgf4CEhOh4ybR9oq/aRlf7/TAMoe67EdCNAH2ZpqDJ 5jrC/C2kXrt0WrXTX5cE0OWo2GHnB+bh0GOziWwUd93zRQ9NAJOEQKJoKtknqrUCDHHK wgW1K3ddASdDU+dnaIoumPZvGhe3y4nuHlqEtpW2OreBXIGy6sIUUXlVlHqrGTQMWH5z tlPw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nvidia.com header.s=n1 header.b=nedmNtDm; 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=nvidia.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id u11si3788780edt.221.2020.11.07.11.22.13; Sat, 07 Nov 2020 11:22:36 -0800 (PST) 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=@nvidia.com header.s=n1 header.b=nedmNtDm; 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=nvidia.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728649AbgKGTRy (ORCPT + 99 others); Sat, 7 Nov 2020 14:17:54 -0500 Received: from hqnvemgate24.nvidia.com ([216.228.121.143]:5730 "EHLO hqnvemgate24.nvidia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725836AbgKGTRx (ORCPT ); Sat, 7 Nov 2020 14:17:53 -0500 Received: from hqmail.nvidia.com (Not Verified[216.228.121.13]) by hqnvemgate24.nvidia.com (using TLS: TLSv1.2, AES256-SHA) id ; Sat, 07 Nov 2020 11:17:57 -0800 Received: from [10.2.62.222] (172.20.13.39) by HQMAIL107.nvidia.com (172.20.187.13) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Sat, 7 Nov 2020 19:17:52 +0000 Subject: Re: [PATCH 1/2] tomoyo: Convert get_user_pages*() to pin_user_pages*() From: John Hubbard To: Souptick Joarder , , , , CC: , , Jan Kara , Matthew Wilcox References: <1604737451-19082-1-git-send-email-jrdr.linux@gmail.com> Message-ID: Date: Sat, 7 Nov 2020 11:17:52 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.12.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="utf-8"; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [172.20.13.39] X-ClientProxiedBy: HQMAIL107.nvidia.com (172.20.187.13) To HQMAIL107.nvidia.com (172.20.187.13) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nvidia.com; s=n1; t=1604776677; bh=yfhdGpRJZc3CvodI5i1IHo+KRBmzHgvXgzVSoUCFcYw=; h=Subject:From:To:CC:References:Message-ID:Date:User-Agent: MIME-Version:In-Reply-To:Content-Type:Content-Language: Content-Transfer-Encoding:X-Originating-IP:X-ClientProxiedBy; b=nedmNtDmoYJfgU992ShmtCC57esM3aLP4lFDsq2VsnRlkgg0vOHucUb25U9gXt0Ui bb46/ufveki0qfrIbDUrdScf5MsqEn/41KZDkL8VMlaTQYixjrZvxgt1S2YBf3lLvh rPqMwfsyGVuVIK5pTa1yry0dJhEqS4MtlTMG2pLS2ZvMvSOkqlMZhSkP0SdnA0jAe6 P2w7IfbrVikCQpNZmVXjazWbJnkzn9y9wrIhJ6EPe+PIa+Rec/wtXsQRKp0Vfre2Kr hbZsXxzeQETQO4DlWHK1dqVwxwM1l7RGyJ/wtLkBRkz1twUZCzdfsIOZOPCrU8A4GB jk38FeRVwJ65g== Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 11/7/20 1:04 AM, John Hubbard wrote: > On 11/7/20 12:24 AM, Souptick Joarder wrote: >> In 2019, we introduced pin_user_pages*() and now we are converting >> get_user_pages*() to the new API as appropriate. [1] & [2] could >> be referred for more information. This is case 5 as per document [1]. > > It turns out that Case 5 can be implemented via a better pattern, as long > as we're just dealing with a page at a time, briefly: > > lock_page() > write to page's data > unlock_page() > > ...which neatly synchronizes with writeback and other fs activities. Ahem, I left out a key step: set_page_dirty()! lock_page() write to page's data set_page_dirty() unlock_page() thanks, -- John Hubbard NVIDIA