Received: by 10.192.165.148 with SMTP id m20csp3069326imm; Mon, 7 May 2018 06:11:29 -0700 (PDT) X-Google-Smtp-Source: AB8JxZoB+qT34qdBc+LUElTUK/YEBvaBYMWisY1oGZ1frIVY6krJEaPLq9vQRsFb6M2lpEA+oSow X-Received: by 2002:a63:6d8b:: with SMTP id i133-v6mr30336777pgc.268.1525698689431; Mon, 07 May 2018 06:11:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525698689; cv=none; d=google.com; s=arc-20160816; b=ExLvviANlEXuOxqX9xI3YDvSXnRGti86Ndn5enQ/MQkWtjl737xSJwncQRFZ5Pil+I hLKvJ2HESZ1mGZN9G5+d3iy4MCK7+yvdjcxhPFKgHGf67O0jLtmkwbeG+wVkjSV2Ce2F +/4v+GC2ElEJBcWHcKgbn3sZmiDXzHJBsP0AZcRDCxWA87qJRCnUoZBLYC8Q6KYNZ/l7 SdFouzuUlMvkdUMjslRQoxsc/3WT/NnuTu3/W3YNBKlh9AIirqGbUnjWZ3CXB3nktp6O d2+qPo0c+9GMPUN1pv3i4zf1DBCt4aMOaaej+yY6ZPXkm3txuGBp56u8zt+vvcH9+39s PGdw== 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:arc-authentication-results; bh=yqT1Rwtyc0QqwQHO7nkE+MBu1oVJ1i3RVEZCKZKLmCg=; b=AsvAyQikQZ4R9ZrOgZbnfEUCXUiDpwHcJy+9mtGLmRG/UnvNp7N+iXtIFKHzSXc2uv LfCHcFy5TWfaDB3OqH2iJCdj/n2QYMuOGOpyz9zgJkC9SYrbPzzh70RrQ8Ufok1BPFj0 rk1FYL8ego9SKTdP/24le6TF86QU4XFQcNFjbANXLEGZCOyI1HCMMD5RkeeqUP+qLkPb fwNr7BAVpCdOd93HIhTbBcRc1DJsKTSmQEYTi+/vtGg6ImuQ+JwAWbc3UBj4V+WplhDU JlpEcXRAIBlq1u0H8BeX78X0JBUIKs8KjiWmV5at6iXh9XgbBi358FH6DbliSQLm+8Hq 3xDQ== ARC-Authentication-Results: i=1; mx.google.com; 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 ay10-v6si20089156plb.120.2018.05.07.06.11.14; Mon, 07 May 2018 06:11:29 -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; 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 S1752051AbeEGNLE (ORCPT + 99 others); Mon, 7 May 2018 09:11:04 -0400 Received: from mga17.intel.com ([192.55.52.151]:37969 "EHLO mga17.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751949AbeEGNLD (ORCPT ); Mon, 7 May 2018 09:11:03 -0400 X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga107.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 07 May 2018 06:11:03 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.49,374,1520924400"; d="scan'208";a="226476542" Received: from black.fi.intel.com ([10.237.72.28]) by fmsmga006.fm.intel.com with ESMTP; 07 May 2018 06:11:00 -0700 Received: by black.fi.intel.com (Postfix, from userid 1000) id 0B86D130; Mon, 7 May 2018 16:10:59 +0300 (EEST) Date: Mon, 7 May 2018 16:10:59 +0300 From: "Kirill A. Shutemov" To: Matthew Wilcox Cc: "Kirill A. Shutemov" , Andy Lutomirski , Andrew Morton , Michal Hocko , Linus Torvalds , X86 ML , Linux-MM , LKML Subject: Re: Proof-of-concept: better(?) page-table manipulation API Message-ID: <20180507131059.3cdpfd4dcnwznhyw@black.fi.intel.com> References: <20180424154355.mfjgkf47kdp2by4e@black.fi.intel.com> <20180507113124.ewpbrfd3anyg7pli@kshutemo-mobl1> <20180507122346.GE18116@bombadil.infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180507122346.GE18116@bombadil.infradead.org> User-Agent: NeoMutt/20170714-126-deb55f (1.8.3) 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 12:23:46PM +0000, Matthew Wilcox wrote: > 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. You assume that the function is a generic one. This may or may not be true. This is subject for refinement anyway. -- Kirill A. Shutemov