Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp57721imm; Mon, 21 May 2018 02:08:28 -0700 (PDT) X-Google-Smtp-Source: AB8JxZrA4X9DK8C703tj73swUBipuJ1vrUsBhoyf4C1GbsBgQPTGORFjKHW7oSGnNizZfloG2fEw X-Received: by 2002:a17:902:8c92:: with SMTP id t18-v6mr19884514plo.337.1526893708054; Mon, 21 May 2018 02:08:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526893708; cv=none; d=google.com; s=arc-20160816; b=xkEJNIue788loLdSX2ogSbDYcCH5NgKoWauBbJDvB7qVvKlcXOjRqZ1VHy5WAHuPQW IBhlC1oWgazEcpNJ8GInSjrG3Xu84AECIo9/s1uUkHZQvWJKVk5B4Gas7xtajokD8+0v t5cIOKk6dcfKD1/vhlT4vyE/3XxujX/Gda6MqwPCppQeGSXHn3wFWPjiaDtjtr0EDXyJ EvDSCsEy+dyLVEMsE+u/FgVtP3vi9Ut2vJAqgfKcQ7NkRAJs0XRWjddfaib/AfscjK9C dhrQMRR0DaBe3OOpA+Y3Hco1aYqQzZmnqFvYzCqv6yYWIQr83hzbPP7IHn08HBCCdXcI hVbQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=e9DfdTNQ/XFX12eH06v6q7NxECRPOFKnQL1kolYD+QE=; b=nUZURPsa/+OW8zBWwjXF+MBjLPiAf0s5AfwMWH2h7f90HaLBLq+4t0471M3x06//+p OhUCTIwP51fcBgLdBE5CpsJ65n+PU969e9nvDuE9Bv58GnrRKxJkWAYPVB9MGhUzC4yi N7tK3uKBTJ/VvQuVEZFQYKPcIEnb9ev271dWLEnHEqh68ISZ3Y7UJpTJFVpvb5dHJN/l 0n4lvHtjVjUE9j8GT9DV/f93LhkqQ4UsCjW77HuAFi+/9cVcTltTAKsOC9sAklu0c3Qm /tAcMfVi/CVSrupq2WDpKcDZPtUEAIBr4v8telS32AqnNmwcPo5Zg7bqpjGlsQ5mTJMm 5Cdg== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x7-v6si4588085pgt.559.2018.05.21.02.08.13; Mon, 21 May 2018 02:08:28 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752663AbeEUJFL (ORCPT + 99 others); Mon, 21 May 2018 05:05:11 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:52440 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751234AbeEUJFG (ORCPT ); Mon, 21 May 2018 05:05:06 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id D0F4FBB409; Mon, 21 May 2018 09:05:05 +0000 (UTC) Received: from jason-ThinkPad-T450s.redhat.com (ovpn-12-30.pek2.redhat.com [10.72.12.30]) by smtp.corp.redhat.com (Postfix) with ESMTP id 5487B4E68B; Mon, 21 May 2018 09:05:01 +0000 (UTC) From: Jason Wang To: mst@redhat.com, jasowang@redhat.com Cc: kvm@vger.kernel.org, virtualization@lists.linux-foundation.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [RFC PATCH net-next 06/12] tuntap: enable premmption early Date: Mon, 21 May 2018 17:04:27 +0800 Message-Id: <1526893473-20128-7-git-send-email-jasowang@redhat.com> In-Reply-To: <1526893473-20128-1-git-send-email-jasowang@redhat.com> References: <1526893473-20128-1-git-send-email-jasowang@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.1]); Mon, 21 May 2018 09:05:05 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.1]); Mon, 21 May 2018 09:05:05 +0000 (UTC) for IP:'10.11.54.5' DOMAIN:'int-mx05.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'jasowang@redhat.com' RCPT:'' Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Signed-off-by: Jason Wang --- drivers/net/tun.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/net/tun.c b/drivers/net/tun.c index 44d4f3d..24ecd82 100644 --- a/drivers/net/tun.c +++ b/drivers/net/tun.c @@ -1697,6 +1697,8 @@ static struct sk_buff *tun_build_skb(struct tun_struct *tun, goto err_xdp; } } + rcu_read_unlock(); + preempt_enable(); skb = build_skb(buf, buflen); if (!skb) { @@ -1710,9 +1712,6 @@ static struct sk_buff *tun_build_skb(struct tun_struct *tun, get_page(alloc_frag->page); alloc_frag->offset += buflen; - rcu_read_unlock(); - preempt_enable(); - return skb; err_redirect: -- 2.7.4