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=-5.4 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 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 D565CC3F2CD for ; Fri, 28 Feb 2020 13:38:06 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 96B9A24699 for ; Fri, 28 Feb 2020 13:38:06 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=ziepe.ca header.i=@ziepe.ca header.b="YOe/jK58" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 96B9A24699 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=ziepe.ca Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 2E2CA6B0005; Fri, 28 Feb 2020 08:38:06 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 2944A6B0006; Fri, 28 Feb 2020 08:38:06 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 181C76B0007; Fri, 28 Feb 2020 08:38:06 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0152.hostedemail.com [216.40.44.152]) by kanga.kvack.org (Postfix) with ESMTP id F26EF6B0005 for ; Fri, 28 Feb 2020 08:38:05 -0500 (EST) Received: from smtpin22.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 75E441801E235 for ; Fri, 28 Feb 2020 13:38:05 +0000 (UTC) X-FDA: 76539639330.22.title32_c65e1f39b342 X-HE-Tag: title32_c65e1f39b342 X-Filterd-Recvd-Size: 4422 Received: from mail-qt1-f196.google.com (mail-qt1-f196.google.com [209.85.160.196]) by imf14.hostedemail.com (Postfix) with ESMTP for ; Fri, 28 Feb 2020 13:38:05 +0000 (UTC) Received: by mail-qt1-f196.google.com with SMTP id j34so2007169qtk.4 for ; Fri, 28 Feb 2020 05:38:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ziepe.ca; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=0bbvuA865Timj4BuvxyTT2b47+/wBTS6sqgiu9Yy1no=; b=YOe/jK58N60EPffctInlzrEQshUiuLX+fee09amDKGPWRa+5l6Fa8AL3YkpjMF3ztA XKCgz3abiuNK0d5vVqwR1bsKD0Ta//0J4r7C480zvBQfbdTDfuoOTdxJOa1vrFFZoveG cCH+BrspCFtOkgb8PZx7BMMqKgMu970/iRvE1BeEO7fPQGXVspnRgju5WTLrts8HGq7U 4aG6vK7u5ZeFwjkmCdJ59nZhXGPvtTAFAoXfoMJ7anu6K4ATnAOuDpaVjN5MT8NNR2h7 k/FGZF6rzYdsX1wL0ChehRQPqL9IsKsxxCyU8n/QQio3RacjWU3BYorzZuPyMPhTa0w4 RWRg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=0bbvuA865Timj4BuvxyTT2b47+/wBTS6sqgiu9Yy1no=; b=rQTrhN52id8grAV9OpZil0PJgWl8FCqdzuPXJt/FUDt0dS1vW0CyzzXdMFsZvBi/Z8 boe7ursGNJd2bUkFIAGNYMFm367UyKB58T5ikeGFH6w+qmBYSfw/SEE5BNmhfjgja6gA 0tunjZOyVPf8VjBSDfCbWP5RBhf7VcVZFyh2lz+k1aDsOn1yHQ1bIgpUIyY8S4arKTER HDxa17pxL/mu4EHhyrSlr2iNBt2nYXKdRhVm/xlqRjFKusMFkEDtxeV3RLhD8+UN3Uy6 qEAKSazTwFbabtvK5b92WLNOKPjGddp9uLvAD3NbDevBKakINNl0YNTsB+9VqlkIEnXE HwsA== X-Gm-Message-State: APjAAAWDCA12TRa1F0V8eJt15/TrCJ/82G89Kev/ZAvYUgHHidd9Roll OoUpmRwuGmCg4G3M4lbDJw9bxA== X-Google-Smtp-Source: APXvYqwQ9LwYjF5uO6CHBDi+zj9lgB2VrFjLklUV07e3bt8Qi7Yeg96BZCEzqnCPtF/Yx11RbKfcug== X-Received: by 2002:ac8:7508:: with SMTP id u8mr4318174qtq.163.1582897084587; Fri, 28 Feb 2020 05:38:04 -0800 (PST) Received: from ziepe.ca (hlfxns017vw-142-68-57-212.dhcp-dynamic.fibreop.ns.bellaliant.net. [142.68.57.212]) by smtp.gmail.com with ESMTPSA id v10sm5158646qtj.26.2020.02.28.05.38.04 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 28 Feb 2020 05:38:04 -0800 (PST) Received: from jgg by mlx.ziepe.ca with local (Exim 4.90_1) (envelope-from ) id 1j7fq7-0007sd-HX; Fri, 28 Feb 2020 09:38:03 -0400 Date: Fri, 28 Feb 2020 09:38:03 -0400 From: Jason Gunthorpe To: Arjun Roy Cc: davem@davemloft.net, akpm@linux-foundation.org, linux-mm@kvack.org, arjunroy@google.com, soheil@google.com, edumazet@google.com, sfr@canb.auug.org.au, geert@linux-m68k.org Subject: Re: [PATCH v3 mm 2/2] mm: vm_insert_pages() checks if pte_index defined. Message-ID: <20200228133803.GO31668@ziepe.ca> References: <20200228054714.204424-1-arjunroy.kdev@gmail.com> <20200228054714.204424-2-arjunroy.kdev@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200228054714.204424-2-arjunroy.kdev@gmail.com> User-Agent: Mutt/1.9.4 (2018-02-28) 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: On Thu, Feb 27, 2020 at 09:47:14PM -0800, Arjun Roy wrote: > diff --git a/mm/memory.c b/mm/memory.c > index d6f834f7d145..47b28fcc73c2 100644 > +++ b/mm/memory.c > @@ -1460,18 +1460,6 @@ static int insert_page_into_pte_locked(struct mm_struct *mm, pte_t *pte, > return 0; > } > > -static int insert_page_in_batch_locked(struct mm_struct *mm, pmd_t *pmd, > - unsigned long addr, struct page *page, pgprot_t prot) > -{ > - int err; > - > - if (!page_count(page)) > - return -EINVAL; > - err = validate_page_before_insert(page); > - return err ? err : insert_page_into_pte_locked( > - mm, pte_offset_map(pmd, addr), addr, page, prot); > -} > - > /* > * This is the old fallback for page remapping. > * > @@ -1500,8 +1488,21 @@ static int insert_page(struct vm_area_struct *vma, unsigned long addr, > return retval; > } > > +#ifdef pte_index It seems a bit weird like this, don't we usually do this kind of stuff with some CONFIG_ARCH_HAS_XX thing? IMHO all arches should implement pte_index as the static inline, that has been the general direction lately. Jason