Received: by 10.192.165.148 with SMTP id m20csp3019209imm; Mon, 7 May 2018 05:24:39 -0700 (PDT) X-Google-Smtp-Source: AB8JxZryi0sGahD3A92IRt12EIknrhXEtl9v7ArKAmsW2fbE9iFbt7pNt+Qm4VmnVEnMowyUpztq X-Received: by 2002:a63:6d41:: with SMTP id i62-v6mr30031400pgc.233.1525695879609; Mon, 07 May 2018 05:24:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525695879; cv=none; d=google.com; s=arc-20160816; b=fZSeHcODQXdP14ydKUEwk+ChhEHMAK3WFSclm8c913tYRLi7Fuvyie2FRM9SvCcsAK BT1FTZ0F5/N4czAoyOUY0yJyz0UELubwV4LZokERiJEBdJILrod3JnRclJVV/CvIt/23 R1ZjvUnekS8YS3tj/vzxaWeSaNYHU0MsOcBuGex0n7zFLgEignmY1OVHj1fOb9k6Bjc+ K9rY/mnYrG1Y3+rrM0bsHZTxrKnf6VGsRcVHxRdf3fr6CTAJUylsY1itjGJKLjqa0j2V H+pXACNr/6Q1kw9mHCKapezfUotf4kx9WxerN6W7OKYmotknXeyQVpARWdSnmJdmfrXs Pqig== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature:arc-authentication-results; bh=szqkIb6cyvH69vhtj0p2P92Ar/1QCNjtgf4I8FaFsL0=; b=tZOKUnxwPaz5+AeDX4h94rE5KjYzBP0BLWJqygSiEs4wjH26yPeAROQTBRd69L+p5m ffAohzyEo6DdNK5LEXBH06LKq5Cn87E/bxOUMvd8afxNwmmN4E5QNtJ2KTwFaHZv6OcA 91rE7YKc/C/RbaQciffhoD94WI5lDX483x++kDsDIXdSTpAyBS0oW4cQgdJ5lpBg1cul lzIMsxtkFoHT9q1SVOtz+Ijp20mcqP1U9A0DGgN6TNi6f20ib+E5k0hHOCZwew7k90Ih i/ka1D2ptjGcPKJrDmI58UoJh7amxn1tLQ61SyUpw4K5Ws3smtXxEhEENgzEuuXQ+DEE LW+g== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@infradead.org header.s=bombadil.20170209 header.b=uboTjSri; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v4si21393836pfe.306.2018.05.07.05.24.25; Mon, 07 May 2018 05:24:39 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@infradead.org header.s=bombadil.20170209 header.b=uboTjSri; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752085AbeEGMXw (ORCPT + 99 others); Mon, 7 May 2018 08:23:52 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:44010 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750881AbeEGMXt (ORCPT ); Mon, 7 May 2018 08:23:49 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; 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:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=uDRiAOKuPLkoxOwFgupUPPJKUqADp5oNC4kmUksEDQ8=; b=uboTjSriJmRRnE6/CScTijFa6 wPB/FC+nRPqa93OE+c9QzQrdhnO3p8TiCmSljI17fVPHNzFVxd9XjuGFcHs6ic6ZCVNDadOlZUqyO JKlzTaMOEYqa7NNoY/bMG5FKPZVNc2YFCmhPVp+O4Zm0bAfvAmJAP2k8HSM1gsou52HO3O3VAXgCz gPqZ543jEXCtPf+6GVCTZfQla0mBw6hdzqqIgf+eiu6z+IZ0reFUkPTpcTGfWa6DpK7Xyf8Fakn/h XkEYvU+h0ORoAZ3ez96wdm5BTSK9OPG9jsq9ATg9GV6Ql8kh3sazmebJ5xuowtUiHt7Dr4UwDd5OC VVZgTwieA==; Received: from willy by bombadil.infradead.org with local (Exim 4.90_1 #2 (Red Hat Linux)) id 1fFfBC-0007Fd-Jy; Mon, 07 May 2018 12:23:46 +0000 Date: Mon, 7 May 2018 05:23:46 -0700 From: Matthew Wilcox To: "Kirill A. Shutemov" Cc: Andy Lutomirski , "Kirill A. Shutemov" , Andrew Morton , Michal Hocko , Linus Torvalds , X86 ML , Linux-MM , LKML Subject: Re: Proof-of-concept: better(?) page-table manipulation API Message-ID: <20180507122346.GE18116@bombadil.infradead.org> References: <20180424154355.mfjgkf47kdp2by4e@black.fi.intel.com> <20180507113124.ewpbrfd3anyg7pli@kshutemo-mobl1> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180507113124.ewpbrfd3anyg7pli@kshutemo-mobl1> User-Agent: Mutt/1.9.2 (2017-12-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, May 07, 2018 at 02:31:25PM +0300, Kirill A. Shutemov wrote: > > Also, what does lvl == 0 mean? Is it the top or the bottom? I think a > > comment would be helpful. > > It is bottom. But it should be up to architecture to decide. That's not true because ... > > > +static inline void ptp_walk(ptp_t *ptp, unsigned long addr) > > > +{ > > > + ptp->ptr = (unsigned long *)ptp_page_vaddr(ptp); > > > + ptp->ptr += __pt_index(addr, --ptp->lvl); > > > +} > > > > Can you add a comment that says what this function does? > > Okay, I will. > > > Why does it not change the level? > > It does. --ptp->lvl. ... you've hardcoded that walking down decrements the level by 1. I don't see that as a defect; it's just part of the API that needs documenting.