Received: by 10.223.185.116 with SMTP id b49csp2331809wrg; Thu, 15 Feb 2018 09:58:37 -0800 (PST) X-Google-Smtp-Source: AH8x226cZmrp65CFH2jcYNyxzmfyCZcA/rtgS7ZxiXMW/NYz7BRn5/FA8SGhdOtxUXJNZt84FaR9 X-Received: by 2002:a17:902:347:: with SMTP id 65-v6mr3268007pld.0.1518717517098; Thu, 15 Feb 2018 09:58:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518717517; cv=none; d=google.com; s=arc-20160816; b=XQa0dgQ++jaaUigYfsn4FSdrVCQ78Wle8bVGJ6RXddGfFclZRbIl3L6oSw/U4P01DL 0ckzOFidxoUPaym06i9dDrxuMtWQtF+9zpUBjfhS5oa+5hslT8WC+AdNtQRobXc7URdA xZf/OPLj4PKWcf8GE0jF4myoBKbAP1wtA7lGDxZLvQeMC3yhEgCHkgF2pELLlwWw/CVL lQrKBbeU54bJBFyHmZNu6RAK8An4RXXYstw5pZnDYdFGNsg03S+BKStKZRI9AdQIDkej sRF3t/CcYrSCwZDAs6JGU8eOYtK0CJGjfwJm/2bh1tiqjX7YeX0q+IenN9hTpDqtiOCa y2IA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date :arc-authentication-results; bh=x/3ZVSsxJYtMTLawg8qNDsAs8qadQkgAKLiwEOPJjaY=; b=M4kuCpwJFP1f2G7YE7+3M5p07FWl4G7zG1LSaPImHnyEhCDcigmjsklBum14sVE47Q oxxoMJDGCgOvWDhLa96utTDLooqKWCfUGSg/C7txTq9+yNScTHSXw/IBPucm16ZJ7gMq kpyTnfEBv4LNs2pTXHEmWf+0+N3SjC7B5q2dLWc38NaQLckxi9QG9lPP6rFA9vFLl59P k3hWFKDcvSQQiMaBmjY//XoXhDxZGrC1m6/rZDJqsrdXIR7+4VAXY6zp7WGXykh5grog +tEoFEbBa1vRG23iNEfmroevGoHRv0nM9sKaGFj5apoUHcXVSKn6omojDgFNA6HVjSYX cSNA== 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 z123si3055462pgb.280.2018.02.15.09.58.22; Thu, 15 Feb 2018 09:58:37 -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 S1165932AbeBOR5G (ORCPT + 99 others); Thu, 15 Feb 2018 12:57:06 -0500 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70]:58752 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1164177AbeBOR5E (ORCPT ); Thu, 15 Feb 2018 12:57:04 -0500 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id ECE3E80D; Thu, 15 Feb 2018 09:57:03 -0800 (PST) Received: from lakrids.cambridge.arm.com (usa-sjc-imap-foss1.foss.arm.com [10.72.51.249]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id B97A33F487; Thu, 15 Feb 2018 09:57:02 -0800 (PST) Date: Thu, 15 Feb 2018 17:57:00 +0000 From: Mark Rutland To: Eric Dumazet Cc: Eric Dumazet , netdev , LKML , David Miller , Willem de Bruijn Subject: Re: v4.16-rc1 misaligned atomics in skb__clone / __napi_alloc_skb Message-ID: <20180215175700.vpiaiam3n7d73k4o@lakrids.cambridge.arm.com> References: <20180215170432.e4wue4osyv3vmdla@lakrids.cambridge.arm.com> <1518716586.3715.205.camel@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1518716586.3715.205.camel@gmail.com> User-Agent: NeoMutt/20170113 (1.7.2) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Feb 15, 2018 at 09:43:06AM -0800, Eric Dumazet wrote: > On Thu, 2018-02-15 at 09:24 -0800, Eric Dumazet wrote: > > > > I will send something more suited to original intent of these commits : > > > > 90e33d45940793def6f773b2d528e9f3c84ffdc7 tun: enable napi_gro_frags() > > for TUN/TAP driver > > 943170998b200190f99d3fe7e771437e2c51f319 tun: enable NAPI for TUN/TAP driver > > Can you try this patch ? Looks good! No splats after 10 minutes with a test that usually fails in a few seconds. FWIW: Tested-by: Mark Rutland Thanks, Mark. >  drivers/net/tun.c |   16 ++++++---------- >  1 file changed, 6 insertions(+), 10 deletions(-) > > diff --git a/drivers/net/tun.c b/drivers/net/tun.c > index 81e6cc951e7fc7c983919365c34842c34bcaedcf..b52258c327d2e1d7c7476de345e49f082909c246 100644 > --- a/drivers/net/tun.c > +++ b/drivers/net/tun.c > @@ -1489,27 +1489,23 @@ static struct sk_buff *tun_napi_alloc_frags(struct tun_file *tfile, > skb->truesize += skb->data_len; > > for (i = 1; i < it->nr_segs; i++) { > + struct page_frag *pfrag = ¤t->task_frag; > size_t fragsz = it->iov[i].iov_len; > - unsigned long offset; > - struct page *page; > - void *data; > > if (fragsz == 0 || fragsz > PAGE_SIZE) { > err = -EINVAL; > goto free; > } > > - local_bh_disable(); > - data = napi_alloc_frag(fragsz); > - local_bh_enable(); > - if (!data) { > + if (!skb_page_frag_refill(fragsz, pfrag, GFP_KERNEL)) { > err = -ENOMEM; > goto free; > } > > - page = virt_to_head_page(data); > - offset = data - page_address(page); > - skb_fill_page_desc(skb, i - 1, page, offset, fragsz); > + skb_fill_page_desc(skb, i - 1, pfrag->page, > + pfrag->offset, fragsz); > + page_ref_inc(pfrag->page); > + pfrag->offset += fragsz; > } > > return skb; >