Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp2727921imj; Mon, 11 Feb 2019 07:36:01 -0800 (PST) X-Google-Smtp-Source: AHgI3Ia1yskEhRwdfr9lh2XWAHKtt1PxZ85nRHbBEjgzuGdNHBBiNkqllyDPFnF1hQzm6eFI21gm X-Received: by 2002:a65:65c9:: with SMTP id y9mr34757174pgv.438.1549899361520; Mon, 11 Feb 2019 07:36:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549899361; cv=none; d=google.com; s=arc-20160816; b=Z1QmZd8rbd26r/fnHvYPLBLJ3JEhSZzW/T9/oOt5SOrByF7o/GK5z7XoyjPDVx+oTy D/HPw5DPw3gHRBrKKEXLj10tmX6vpuK1m74Vd+FU6wYt8oaklvOQ00ubem+SinGFERiC 7e90o9adfv/ldUe+C8+522J3tJoiPY/bvtaQvjpM/4jz7FkqFQbzw4PVoVN5sKbfKhGC aQhA3ZM2PgfXD2lOWZ6DDQUWYzxnSYGoNfFELVNDbOqKsO5KT4CwCHb9Gwb+cWqYRn9o 0I5T25/UQU5omyHGjk4obRXCx48rMGAzQaae2ZAeRDnuBQdFmBLDtLMIjMAAO6PI/GTy mz4w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=6AsydycaEfknojHFFUgxjTMXgbgmE80KrPuR78p7KI0=; b=cm1OapI44UCltCGB8rXmfrbYztu7wdEgiEZisH6FMh08sV0d8eS/eOIwUM70prHpEr weKHCPg8MQ97haknxiRG6x1KAkCUNU4KkeFlXLbgs0nOD8LgcNFLstHEiLGi1IaBaTmG otaY5ns7GqQ2/ixVkacBYw8iLk6xM+VmzNMKygE081OKlcwt2XKMa2Ju45ph1j8QUezy ewrYwkoCnlNJRKqSMxnf9siK62VuoLh90KYdjvkEXkNnrxpYX0VxMzYmPRaxGyoNBGIW mh8m2wIVer/CiKWb/iHcDwL+kAhNwCZzzzeZEI3Ie0gFFIX+kxxq+/wJImAlhGU5o9tb LnGg== 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 l7si10972423plg.390.2019.02.11.07.35.45; Mon, 11 Feb 2019 07:36:01 -0800 (PST) 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 S2389306AbfBKPdf (ORCPT + 99 others); Mon, 11 Feb 2019 10:33:35 -0500 Received: from www62.your-server.de ([213.133.104.62]:41086 "EHLO www62.your-server.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728364AbfBKPdd (ORCPT ); Mon, 11 Feb 2019 10:33:33 -0500 Received: from [78.46.172.3] (helo=sslproxy06.your-server.de) by www62.your-server.de with esmtpsa (TLSv1.2:DHE-RSA-AES256-GCM-SHA384:256) (Exim 4.89_1) (envelope-from ) id 1gtDaM-0007KE-6j; Mon, 11 Feb 2019 16:33:30 +0100 Received: from [2a02:1203:ecb1:b710:c81f:d2d6:50a9:c2d] (helo=linux.home) by sslproxy06.your-server.de with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.89) (envelope-from ) id 1gtDaL-000Ow1-WC; Mon, 11 Feb 2019 16:33:30 +0100 Subject: Re: [PATCH 1/2] xsk: do not use mmap_sem To: =?UTF-8?B?QmrDtnJuIFTDtnBlbA==?= , Davidlohr Bueso Cc: akpm@linux-foundation.org, linux-mm@kvack.org, LKML , "David S . Miller" , Bjorn Topel , Magnus Karlsson , Netdev , Davidlohr Bueso , dan.j.williams@intel.com References: <20190207053740.26915-1-dave@stgolabs.net> <20190207053740.26915-2-dave@stgolabs.net> From: Daniel Borkmann Message-ID: Date: Mon, 11 Feb 2019 16:33:29 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit X-Authenticated-Sender: daniel@iogearbox.net X-Virus-Scanned: Clear (ClamAV 0.100.2/25357/Mon Feb 11 11:38:50 2019) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org [ +Dan ] On 02/07/2019 08:43 AM, Björn Töpel wrote: > Den tors 7 feb. 2019 kl 06:38 skrev Davidlohr Bueso : >> >> Holding mmap_sem exclusively for a gup() is an overkill. >> Lets replace the call for gup_fast() and let the mm take >> it if necessary. >> >> Cc: David S. Miller >> Cc: Bjorn Topel >> Cc: Magnus Karlsson >> CC: netdev@vger.kernel.org >> Signed-off-by: Davidlohr Bueso >> --- >> net/xdp/xdp_umem.c | 6 ++---- >> 1 file changed, 2 insertions(+), 4 deletions(-) >> >> diff --git a/net/xdp/xdp_umem.c b/net/xdp/xdp_umem.c >> index 5ab236c5c9a5..25e1e76654a8 100644 >> --- a/net/xdp/xdp_umem.c >> +++ b/net/xdp/xdp_umem.c >> @@ -265,10 +265,8 @@ static int xdp_umem_pin_pages(struct xdp_umem *umem) >> if (!umem->pgs) >> return -ENOMEM; >> >> - down_write(¤t->mm->mmap_sem); >> - npgs = get_user_pages(umem->address, umem->npgs, >> - gup_flags, &umem->pgs[0], NULL); >> - up_write(¤t->mm->mmap_sem); >> + npgs = get_user_pages_fast(umem->address, umem->npgs, >> + gup_flags, &umem->pgs[0]); >> > > Thanks for the patch! > > The lifetime of the pinning is similar to RDMA umem mapping, so isn't > gup_longterm preferred? Seems reasonable from reading what gup_longterm seems to do. Davidlohr or Dan, any thoughts on the above? Thanks, Daniel