Received: by 2002:a05:6a10:6d10:0:0:0:0 with SMTP id gq16csp883459pxb; Fri, 22 Apr 2022 13:22:45 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw4zSfNYl1eNnDSI3d1uvDcNodAE/Mo5TJqav7gHj2Gf+pKYn08080g0fBdg9OMHQ2asEpq X-Received: by 2002:a17:90a:5298:b0:1ca:7fb3:145 with SMTP id w24-20020a17090a529800b001ca7fb30145mr7350254pjh.200.1650658965063; Fri, 22 Apr 2022 13:22:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1650658965; cv=none; d=google.com; s=arc-20160816; b=fv5QoHwtxpT+tXabmCMsxS7O1eKM0APj0813jPAQh9Dh51rDxo75ANTE5q+HmiaEBU aNv8HHe2fFpQueANZkSVCgXu3h4NYbVrfzeUgNkqwkCoICDmg0Sr/APnc24Ua+Vi0JHp T22LrSaj5Bxx50suGGGrn9yA6SpiHKPFalynu2Vk6warwYxWR1g+U8r8J5NEsQ2g1cIZ Euu2ZXngJ4s+qEiUJzkCf/8et7TYyzdfJtWlDr9BTs+9+8wU5E5BtX5FMoWuzfdL5lU+ 63HBObyIKgbqpdBr0qsLhrxK+3c+RZkMGMQJvdi0wWEeRKHiWQmAxcO8Tvv2rXlZbxnN IqeA== 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=ZHu1IjrxFPAxctjr6z8UrS3Jvrp77wKNQp96LMJGgEM=; b=iGTY9f2FXPW0K/PLgyK6fUq0O9VTOMOfrz6LIPt/YBwQCs4gwBiuiOAR7RrZA1ja09 hNe4k/iGhD7juo+2GGTlTBas5kTro7mE92F0Kk0n+46zflQTFrhmbIiQeHSZrUEkcckT mrx3ZobdI6Zc7giX6s783b0bxQbrNUBeXCgN6RLz2dmQ6uGKUC6SpxaB6A15LK3qQbcj Gv7GTPwtxLUgcJvoxvNHo05oi/7mzjblJJt56pcf+2HtkoqD56Ny/i9NIVcVSQAfoUZB 9rJUcu6g/01rED8PKUXgx3EdFnkE8oT7uKY6GPrUWlNGdgcaFqS3M6PuohBCRwDlewh1 vzzQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=V7My+BMP; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id u6-20020a170902bf4600b001560b636be5si8401725pls.189.2022.04.22.13.22.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Apr 2022 13:22:45 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=V7My+BMP; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 6C7F225FFD0; Fri, 22 Apr 2022 12:09:15 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229698AbiDRVem (ORCPT + 99 others); Mon, 18 Apr 2022 17:34:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44916 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229560AbiDRVel (ORCPT ); Mon, 18 Apr 2022 17:34:41 -0400 Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6D0782C101; Mon, 18 Apr 2022 14:32:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1650317521; x=1681853521; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=pWZo464sUxiW05q7McGFoy+T3hUzXkIV8S9hvGadCbk=; b=V7My+BMPtmG7izUc61BcR9XgyEbOotD4ogXJUIlBnwqRZkBe3SZVFlqk RDl90inmGS9xSw/9Fu2bMq1DuU/D9bFsUCMQvbw2WnbfR/sLDJXOJ/2nh /vS8P036O1X0aE2i+cMe8vMTOnAbsuDhPB3Pj6S7Tq/URphulJ7lXEnHs YzzHmTHzoSnGBA34diZsTuMbi7zEzFbuH0WWCwMBOtpAR4R1i7tHtaOcq cm2DEY6HtcIPlZPumbMl9atXJJTmeTD/GD/vB42xL7O3YPtp2WSJbSNFW G1mrbhX98QR6UR1NddosBRgqSIF/69/v29vRNKTx8YUH+iuXZsss06TGJ A==; X-IronPort-AV: E=McAfee;i="6400,9594,10321"; a="250917657" X-IronPort-AV: E=Sophos;i="5.90,270,1643702400"; d="scan'208";a="250917657" Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Apr 2022 14:32:00 -0700 X-IronPort-AV: E=Sophos;i="5.90,270,1643702400"; d="scan'208";a="804431077" Received: from moseshab-mobl1.amr.corp.intel.com (HELO localhost) ([10.209.143.127]) by fmsmga006-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Apr 2022 14:32:00 -0700 Date: Mon, 18 Apr 2022 14:32:00 -0700 From: Ira Weiny To: "Fabio M. De Francesco" Cc: Jonathan Corbet , Andrew Morton , SeongJae Park , Jiajian Ye , Thomas Gleixner , Matthew Wilcox , Peter Zijlstra , outreachy@lists.linux.dev, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v3 2/2] Documentation/vm: Include kernel-doc to highmem.rst Message-ID: References: <20220415231917.25962-1-fmdefrancesco@gmail.com> <20220415231917.25962-3-fmdefrancesco@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220415231917.25962-3-fmdefrancesco@gmail.com> X-Spam-Status: No, score=-2.5 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Apr 16, 2022 at 01:19:17AM +0200, Fabio M. De Francesco wrote: > Include kernel-doc comments to highmem.rst from > include/kernel/highmem.h. > > From now on, the "Using kmap_atomic" section is redundant and obsolete, > therefore remove it. > > Cc: Jonathan Corbet > Cc: Thomas Gleixner > Cc: Ira Weiny > Cc: Matthew Wilcox > Cc: Peter Zijlstra > Signed-off-by: Fabio M. De Francesco Reviewed-by: Ira Weiny > --- > Documentation/vm/highmem.rst | 41 ++++++------------------------------ > 1 file changed, 6 insertions(+), 35 deletions(-) > > diff --git a/Documentation/vm/highmem.rst b/Documentation/vm/highmem.rst > index 12dcfbee094d..5dcee6233cd5 100644 > --- a/Documentation/vm/highmem.rst > +++ b/Documentation/vm/highmem.rst > @@ -117,41 +117,6 @@ The kernel contains several ways of creating temporary mappings: > synchronization to unmap. > > > -Using kmap_atomic > -================= > - > -When and where to use kmap_atomic() is straightforward. It is used when code > -wants to access the contents of a page that might be allocated from high memory > -(see __GFP_HIGHMEM), for example a page in the pagecache. The API has two > -functions, and they can be used in a manner similar to the following:: > - > - /* Find the page of interest. */ > - struct page *page = find_get_page(mapping, offset); > - > - /* Gain access to the contents of that page. */ > - void *vaddr = kmap_atomic(page); > - > - /* Do something to the contents of that page. */ > - memset(vaddr, 0, PAGE_SIZE); > - > - /* Unmap that page. */ > - kunmap_atomic(vaddr); > - > -Note that the kunmap_atomic() call takes the result of the kmap_atomic() call > -not the argument. > - > -If you need to map two pages because you want to copy from one page to > -another you need to keep the kmap_atomic calls strictly nested, like:: > - > - vaddr1 = kmap_atomic(page1); > - vaddr2 = kmap_atomic(page2); > - > - memcpy(vaddr1, vaddr2, PAGE_SIZE); > - > - kunmap_atomic(vaddr2); > - kunmap_atomic(vaddr1); > - > - > Cost of Temporary Mappings > ========================== > > @@ -190,3 +155,9 @@ The general recommendation is that you don't use more than 8GiB on a 32-bit > machine - although more might work for you and your workload, you're pretty > much on your own - don't expect kernel developers to really care much if things > come apart. > + > + > +Functions > +========= > + > +.. kernel-doc:: include/linux/highmem.h > -- > 2.34.1 >