From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-14.4 required=3.0 tests=DKIMWL_WL_MED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,USER_IN_DEF_DKIM_WL autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id BAA34C35669 for ; Fri, 21 Feb 2020 21:26:12 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 7AF9624650 for ; Fri, 21 Feb 2020 21:26:12 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="rjnrJJAk" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7AF9624650 Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=google.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 2D3EC6B0003; Fri, 21 Feb 2020 16:26:12 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 2834A6B0006; Fri, 21 Feb 2020 16:26:12 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 172106B0007; Fri, 21 Feb 2020 16:26:12 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0072.hostedemail.com [216.40.44.72]) by kanga.kvack.org (Postfix) with ESMTP id EEC186B0003 for ; Fri, 21 Feb 2020 16:26:11 -0500 (EST) Received: from smtpin11.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 942C9181AEF1A for ; Fri, 21 Feb 2020 21:26:11 +0000 (UTC) X-FDA: 76515417342.11.oven97_3600d973eed28 X-HE-Tag: oven97_3600d973eed28 X-Filterd-Recvd-Size: 5548 Received: from mail-wr1-f65.google.com (mail-wr1-f65.google.com [209.85.221.65]) by imf17.hostedemail.com (Postfix) with ESMTP for ; Fri, 21 Feb 2020 21:26:10 +0000 (UTC) Received: by mail-wr1-f65.google.com with SMTP id z3so3590806wru.3 for ; Fri, 21 Feb 2020 13:26:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=71+c2XFCzPDn9sQ5WaRcN6SLCIO9i6WDAyUrS/0w1so=; b=rjnrJJAk0d+yNDyqoC/jb0fl3VsITPsMUrRAoXjGrToZei1XxtnC/4zsIo4Zwv3MwI aeiZTRVxOhzNwjUc2gnMlpuVGVrz/0xraU48xUl3GBH8+C4KlkNxrQwt1tSP/jfX91SX vbMBLvkNDgIIL/cld5A4aa3vWp7hdhS0CQWdKbdYQw9fHE3bM98XIi37X+kUwEhBLAKB a/+xfmGWuFP7oCEFT6svZfAGMmgv36cODljeII+8kVKPe7opGqWiWrQfjZGy8C1Plo2r dxx5+X7REoUqp7izeDIW3vPf264Qt7eY5iMFP5/DD8H52N9aJyRzuVj9YZnGZeEzVWOO 7N7w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=71+c2XFCzPDn9sQ5WaRcN6SLCIO9i6WDAyUrS/0w1so=; b=sgKurjs5p8s7/+bcUyHEMyLI4r8vlqsZqx5zteV3NBodjczZjGIQTKTTqJtPxbuO3j jPqEVRGleW6lgxjt3d0LzCE4HqmjVrd8/hAXn758D6jjKwjrUJW6NyC53Keino5ouvoY 5/+n3xwgdjQEK+PmLib5UYN4cjp0HqQkLDYTKfTawB/H31c0UGSPITYZm460tPRMMaPA y2aCOezTHzExZW63NVtZRzvUc752jXTh8E2+OGRqcaa4aIr3PHHY514aUYoBu8SEGHG0 K2tt1n2f2Imd6h86L+WmnrHQsB9nWyFtupBpAzbpSEw3R/7fMMbqyqXZFw0ZGyAwwxDF 1mJg== X-Gm-Message-State: APjAAAVenIPATm1DWwt3Aw92aiMLHO+W57r6oAa1Qg4ZuLTUHJcPVD81 4fVyzGizNzMcv63x6m3cedAA1SatctlRYU3ShiCBTg== X-Google-Smtp-Source: APXvYqy+IDMM6EfYxx2DtGzDa/wgZou/bEhhGQtbJ9CxtF0j7N7HYUuEiyHiSmBwWh/k4T1ibUpy1toq9OSvwyDikDQ= X-Received: by 2002:a5d:674d:: with SMTP id l13mr49523226wrw.11.1582320369525; Fri, 21 Feb 2020 13:26:09 -0800 (PST) MIME-Version: 1.0 References: <20200221211707.257960-1-arjunroy.kdev@gmail.com> In-Reply-To: <20200221211707.257960-1-arjunroy.kdev@gmail.com> From: Arjun Roy Date: Fri, 21 Feb 2020 13:25:58 -0800 Message-ID: Subject: Re: [PATCH mm] mm: Bring sparc pte_index() semantics inline with other platforms. To: Arjun Roy Cc: David Miller , Andrew Morton , linux-mm@kvack.org, Soheil Hassas Yeganeh , Eric Dumazet , Stephen Rothwell Content-Type: text/plain; charset="UTF-8" X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: David - For full context, this is for a patchset I was working on within MM to reduce spinlock operations for TCP receive zerocopy - which is in and of itself a bit of a complicated situation since it spans mm and net-next - but this change specifically was to fix building on sparc for that patch set. Stephen (cc'd) suggested that perhaps one route would be to get your ACK for this patch and have it merged into mm, rather than the sparc tree. For that matter, I'm still curious as to the best process for merging the TCP portion of the patch set - would be happy to hear any ideas you have. I suggested one possibility may be to delay the TCP portion till net-next eventually picks up the rest of the changes, and just change TCP then, but am not sure whether that is the best approach. Thanks, -Arjun On Fri, Feb 21, 2020 at 1:17 PM Arjun Roy wrote: > > From: Arjun Roy > > pte_index() on platforms other than sparc return a numerical index. > On sparc, it returns a pte_t*. This presents an issue for > vm_insert_pages(), which relies on pte_index() to find the offset for > a pte within a pmd, for batched inserts. > > This patch: > 1. Modifies pte_index() for sparc to return a numerical index, like > other platforms, > 2. Defines pte_entry() for sparc which returns a pte_t* > (as pte_index() used to), > 3. Converts existing sparc callers for pte_index() to use pte_entry(). > > Signed-off-by: Arjun Roy > > --- > arch/sparc/include/asm/pgtable_64.h | 11 ++++++----- > 1 file changed, 6 insertions(+), 5 deletions(-) > > diff --git a/arch/sparc/include/asm/pgtable_64.h b/arch/sparc/include/asm/pgtable_64.h > index 65494c3a420e..851ed0f99159 100644 > --- a/arch/sparc/include/asm/pgtable_64.h > +++ b/arch/sparc/include/asm/pgtable_64.h > @@ -907,11 +907,12 @@ static inline unsigned long pud_pfn(pud_t pud) > (((address) >> PMD_SHIFT) & (PTRS_PER_PMD-1))) > > /* Find an entry in the third-level page table.. */ > -#define pte_index(dir, address) \ > - ((pte_t *) __pmd_page(*(dir)) + \ > - ((address >> PAGE_SHIFT) & (PTRS_PER_PTE - 1))) > -#define pte_offset_kernel pte_index > -#define pte_offset_map pte_index > +#define pte_index(address) \ > + ((address >> PAGE_SHIFT) & (PTRS_PER_PTE - 1)) > +#define pte_entry(dir, address) \ > + ((pte_t *) __pmd_page(*(dir)) + pte_index(address)) > +#define pte_offset_kernel pte_entry > +#define pte_offset_map pte_entry > #define pte_unmap(pte) do { } while (0) > > /* We cannot include at this point yet: */ > -- > 2.25.0.265.gbab2e86ba0-goog >