Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp231710iob; Wed, 18 May 2022 00:34:33 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwR2Ml2rQadJIhJB9nk5hB9sMpdSz86aXwPd4NGxiiy7hEJA/lIBv4dGrB7qRqcHFDAdRZP X-Received: by 2002:a65:6a15:0:b0:3f6:1815:f540 with SMTP id m21-20020a656a15000000b003f61815f540mr52378pgu.45.1652859272871; Wed, 18 May 2022 00:34:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652859272; cv=none; d=google.com; s=arc-20160816; b=IRhlFtu/R5IAbtiW3dN25Qk5oEvQo1A82sMRv3OLemaubDlI9TEAZT2uLKROWsLf3G cn5EcODsNo5zI0qxLh3LCzQQFxMnXPnYSowxwiRYlCMx9vwwvAO2Z05PsAQyUOquGNo4 cg4hzCvRl69hC98qNdmnBwko7573CivZ6JLIRr7/9c0Ez8M3gswFveWPUedv4YEr8V+l fdafia+HAKinU2R8A0F8wrsnFoEbNkkW/Vgiz44YQLtjHwH39pPSd1zjc1cM6V3ARBSp SQB+6SQMv1Lpkq0eceIfPAMkJdd4horStv8YcZY0E2vDyUtzXYUR/SAS7IyGbI5VOTmK Hnhg== 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=OSnS9Gc8JFL+vsVD6+x2CBXZoMLLZDp5qoKeoDP2gxA=; b=gVG7zPb/661z0eO0l45Fbei8D9+ST8Ta4KXdbMfgRDOsUeyac4q+HKWXCVVF/i82oc /INPJj3F29NmPhbjyAqUCU+ChD4cpjlAgDbO/YaACJoJuS5uYPVCqMsXF7YnHZ3zhLFf 9bXHOOLx+sNE/v4M6dkG6WsDQzVmTxHhgTgF162FIRsmkJC8g8RuZH23dFunE+gR4Ury gH1BwzvrZuOhOWA40Ptd2xcxxGXkXhdvGFpIdoGlV2KblvegP/Sq+XaaFAHfaV0kici2 7RIu9qaMg7JLX+N/oJHzQVQlxWDRazzMN8El16AQ+rE2fMc2TtGhnj39eOou5TEoHdJ5 UprA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=ayjs67fD; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id t5-20020a17090340c500b0015e89bf8982si1608177pld.261.2022.05.18.00.34.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 May 2022 00:34:32 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=ayjs67fD; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id A12CA7DE31; Wed, 18 May 2022 00:33:55 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232127AbiERHdu (ORCPT + 99 others); Wed, 18 May 2022 03:33:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53762 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232171AbiERHds (ORCPT ); Wed, 18 May 2022 03:33:48 -0400 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 01364880CB for ; Wed, 18 May 2022 00:33:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=OSnS9Gc8JFL+vsVD6+x2CBXZoMLLZDp5qoKeoDP2gxA=; b=ayjs67fDG9+njrHbDEJTD9Wpn+ VfAbhXrt8x9HPt6bho0wfOK+tWDf7fjXj8G4RLKd5dc0b1p8x+ilq5A7AtI5f1yhYST6I0NI5UZKz 73B+bwrgwHckQsuq/5T09mhlu4nBzsrhS7wDDkhYppgGq64NAE3TDa+H3CD5YlnzmewQ015Bx9okK DTqg8Ni3QfQgPdFmEezZHKT8FlcB4BWofb8rtIxoR4b2ef0qpVY+SN4tD3pYeZ8rBCDxF+ttcSusm q91Uo4Sgx8Du8i91hpDZE/+wCBUhxry0SG7ENO5Q3RSEeOOKm4VboHdSk2/44h1oM36yQ/YYoWnno 2BpUPT+w==; Received: from hch by bombadil.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1nrEBk-0006Rr-K7; Wed, 18 May 2022 07:33:44 +0000 Date: Wed, 18 May 2022 00:33:44 -0700 From: Christoph Hellwig To: Ira Weiny Cc: Christoph Hellwig , Dave Hansen , "H. Peter Anvin" , Dan Williams , Fenghua Yu , Rick Edgecombe , "Shankar, Ravi V" , linux-kernel@vger.kernel.org Subject: Re: [PATCH V10 33/44] kmap: Make kmap work for devmap protected pages Message-ID: References: <20220419170649.1022246-1-ira.weiny@intel.com> <20220419170649.1022246-34-ira.weiny@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no 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 Tue, May 17, 2022 at 03:46:55PM -0700, Ira Weiny wrote: > Ok there is a trade off here which I'm not sure is a good idea. > > In order to make kmap faster I carefully placed the devmap_protected() call > completely inline.[1] This specifically checks the PGMAP_PROTECTION flag in > dev_pagemap.[1] > > I see only 2 ways of not including memremap.h in highmem-internal.h. > > 1) Make this check a function call and place it in memremap.c > 2) Move struct dev_pagemap (and it's dependencies) to another header. > > Number 2 negates any positive effect of splitting the header file. > > Number 1 is going to force some overhead on all ZONE_DEVICE pages if PMEM is in > the system. > > Do you think the extra run time overhead is a reasonable trade off to > eliminating the header? Well, given how big these devmap helpes are it seems like they should be out of line anyway due to the code size impact. It would be great to compare the code size for the cases of: 1) baseline kernel 2) devmap protection inline 3) devmap protection out of line And maybe you need to add linux-mm and Thomas to get a few more opinions.