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=-8.3 required=3.0 tests=DKIMWL_WL_MED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_IN_DEF_DKIM_WL autolearn=no 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 1FBBDC352A3 for ; Thu, 13 Feb 2020 22:07:09 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id D50DB217F4 for ; Thu, 13 Feb 2020 22:07:08 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="ZjFS4r7b" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D50DB217F4 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 726A66B05B3; Thu, 13 Feb 2020 17:07:08 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 6D6106B05B5; Thu, 13 Feb 2020 17:07:08 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 612F76B05B6; Thu, 13 Feb 2020 17:07:08 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0070.hostedemail.com [216.40.44.70]) by kanga.kvack.org (Postfix) with ESMTP id 46FC76B05B3 for ; Thu, 13 Feb 2020 17:07:08 -0500 (EST) Received: from smtpin01.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id F0A7D181AEF15 for ; Thu, 13 Feb 2020 22:07:07 +0000 (UTC) X-FDA: 76486490094.01.vein11_5b5376424401b X-HE-Tag: vein11_5b5376424401b X-Filterd-Recvd-Size: 4392 Received: from mail-wm1-f65.google.com (mail-wm1-f65.google.com [209.85.128.65]) by imf42.hostedemail.com (Postfix) with ESMTP for ; Thu, 13 Feb 2020 22:07:07 +0000 (UTC) Received: by mail-wm1-f65.google.com with SMTP id p17so8502256wma.1 for ; Thu, 13 Feb 2020 14:07:07 -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=xDjQGbNYIrgDUILgWgtabhg5xTMNM/MqQjIcUQH38tk=; b=ZjFS4r7b+2HbjflGUPMaa2nJC/vZOO2WMF8QBRln/sJls2qItOz71S5ZbjAzXwzYbR bJ5zugBmGM8MnnRecxz6T1ku9ef+I19FOSl+PY+5A2grT/5cgFerzznBJXWN9d959Yw6 bybdD+smWXo72hUxIOfZcJyxsh4dtkMZajvWZgfBsP4W9FPa94mA4hCQan0W8++2i0Tp 0VskwUWm9YXU1LefkcABcjvfEvph2gIjjFfXtx34l9+ZspaWMHToT0GqvP3VgXIpkP43 mJhc0u2wisZr55uU8Xq9vWDfOaAG0QyUfvWN1tD4xA0tjtqsxekRVhrfjlEFHupEHKz2 3AXA== 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=xDjQGbNYIrgDUILgWgtabhg5xTMNM/MqQjIcUQH38tk=; b=m0yOANukmwaHk8Slt0V3sj5swoezzPpmMthffsgmmXYN90KbN9x9Q8GxNSNY6pwpRA 9gQN7rwhG0Lz0ITmEGcNKtQeW7vV1Eb1jDfgnYe5YsCjZpjWZJxflfDPj/fwAQtzFW/h oEwc50LXIri0BSzi4dRdHTvs4geQW5wLGEoQ/ZORD5sVCEXi1ZRWIbKq3Q+Af2Q7DGZv OnABhNhZ5Ohf0w1wwTFTqDfHonVJoHJeuSk7/XeieCLAFx9WukJttfhhd96yuVR8k3eM HONPLy6J0mv1Z74W7Lqncn285sC0IOmM28+doqb0j8x1PXb9NDjGffrTh7YcGvlsh/U9 XKgw== X-Gm-Message-State: APjAAAXAhIlZphiR/ZX+uvlZP3rDwAj2iVqxrBcWTY8C7R/AalwM3bJO hv33ztrXYYABzRpWHO6r6HXZ6mRZaM2wc20iGQldPA== X-Google-Smtp-Source: APXvYqweAGOTxJ3tHjE53HI+a2dp1jKgjevEVhFy62A84q7gs10oq5FPkRiM3QMNPr9PqgFSSORAHyTsb1wliVbSN0U= X-Received: by 2002:a1c:4857:: with SMTP id v84mr199500wma.8.1581631625882; Thu, 13 Feb 2020 14:07:05 -0800 (PST) MIME-Version: 1.0 References: <20200128025958.43490-1-arjunroy.kdev@gmail.com> <20200128025958.43490-2-arjunroy.kdev@gmail.com> <20200213215407.GT7778@bombadil.infradead.org> In-Reply-To: <20200213215407.GT7778@bombadil.infradead.org> From: Arjun Roy Date: Thu, 13 Feb 2020 14:06:53 -0800 Message-ID: Subject: Re: [PATCH resend mm,net-next 2/3] mm: Add vm_insert_pages(). To: Matthew Wilcox Cc: Arjun Roy , davem@davemloft.net, netdev@vger.kernel.org, Andrew Morton , linux-mm@kvack.org, Eric Dumazet , Soheil Hassas Yeganeh 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: On Thu, Feb 13, 2020 at 1:54 PM Matthew Wilcox wrote: > > On Mon, Jan 27, 2020 at 06:59:57PM -0800, Arjun Roy wrote: > > int vm_insert_page(struct vm_area_struct *, unsigned long addr, struct page *); > > +int vm_insert_pages(struct vm_area_struct *vma, unsigned long addr, > > + struct page **pages, unsigned long *num); > > int vm_insert_pfn(struct vm_area_struct *vma, unsigned long addr, > > unsigned long pfn); > > Sorry I didn't notice these patches earlier. I'm not thrilled about > the addition of a new vm_insert_* operation; we're moving towards a > vmf_insert_* API. There are almost no users left of vm_insert_page > (10, at a quick count). Once they're all gone, we can switch the > underlying primitives over to a vm_fault_t return type and get rid of the > errno-to-vm-fault translation step that currently goes on. > > So ... is this called in the fault path? Do you have a struct vm_fault > around? Can you handle a vm_fault_t return value instead of an errno? This is not a page fault, really. This customer of vm_insert_page() is the TCP receive zerocopy code, which is remapping pages from the NIC into the userspace process (in lieu of sys_recvmsg()'s copy). See: tcp_zerocopy_receive() in net/ipv4/tcp.c . I took a peek at vmf_insert_page(). I think that hides the presence of EBUSY, which would be a necessary signal for us. If that was exposed I think vm_fault_t could be fine, *but* I shall defer to Eric for actually deciding on it. -Arjun