From owner-freebsd-net@freebsd.org Mon Apr 20 23:39:49 2020 Return-Path: Delivered-To: freebsd-net@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 46C1F2B320D for ; Mon, 20 Apr 2020 23:39:49 +0000 (UTC) (envelope-from ricera10@gmail.com) Received: from mail-ej1-f52.google.com (mail-ej1-f52.google.com [209.85.218.52]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 495jpr1Hrmz4Kcp; Mon, 20 Apr 2020 23:39:48 +0000 (UTC) (envelope-from ricera10@gmail.com) Received: by mail-ej1-f52.google.com with SMTP id n4so9432565ejs.11; Mon, 20 Apr 2020 16:39:47 -0700 (PDT) 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=55fQHNAwzeUqJw9l0yZZGYEWcgkrv1HcyOIOrNf0Kxw=; b=FzxS91ri4dbPqxDYX7yWtxUyItQhxA0ctdoJ8v5IZ5pUaZ4epVks6fS+jyWprT4z9K PLM5Uh1ImW8FUARvmQmqwemyDZVOsTnkL8IWUxS7i8AkNZaT9LE6v+9cjo5K5vaL/Y7s vrPdt4lsRo32CvUxwf0ZMSCu4juF5Rw07YvJBkylxTnQIn3XM3usLPg/3quLrRYbvwcC wWEITLhe3ApZxgOpspQuqpQATOC8Lm/RAZd0Tal2XQM5DFGCgygjfHS/IDEcRCP8ccR5 GDQ1IdbRYgZ27aZw9UrE9Lrx3gojeWNzMOvjkaNb5e0v7LPY5U22fOqPnlPCgb+w13be dS3g== X-Gm-Message-State: AGi0PuYbYZoHSF9YvF8alvqO5AknYhKhh+6iA6MC14++w29dXBL3oS57 G0is4ajanJCaQPF31tSB2kU33gVnv1c= X-Google-Smtp-Source: APiQypIUcEsOCKnHv2S4ShMT1q247FX+2LCAEerQTdtaJioFyoz1qi636xvx6z0WGaa4om+8caDGLQ== X-Received: by 2002:a17:906:412:: with SMTP id d18mr17257450eja.54.1587425986436; Mon, 20 Apr 2020 16:39:46 -0700 (PDT) Received: from mail-ed1-f45.google.com (mail-ed1-f45.google.com. [209.85.208.45]) by smtp.gmail.com with ESMTPSA id sa29sm62826ejb.39.2020.04.20.16.39.45 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 20 Apr 2020 16:39:46 -0700 (PDT) Received: by mail-ed1-f45.google.com with SMTP id t12so5537736edw.3; Mon, 20 Apr 2020 16:39:45 -0700 (PDT) X-Received: by 2002:aa7:d5d5:: with SMTP id d21mr17048133eds.160.1587425985715; Mon, 20 Apr 2020 16:39:45 -0700 (PDT) MIME-Version: 1.0 References: <20200212222219.GE83892@raichu> <20200328225150.GA82767@raichu> <20200331192024.GE97238@raichu> <20200406212903.GA55712@raichu> <20200407232347.GA5605@raichu> In-Reply-To: From: Eric Joyner Date: Mon, 20 Apr 2020 16:39:07 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: Issue with epoch_drain_callbacks and unloading iavf(4) [using iflib] To: Mark Johnston Cc: Hans Petter Selasky , freebsd-net@freebsd.org, shurd , John Baldwin , Drew Gallatin X-Rspamd-Queue-Id: 495jpr1Hrmz4Kcp X-Spamd-Bar: / Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of ricera10@gmail.com designates 209.85.218.52 as permitted sender) smtp.mailfrom=ricera10@gmail.com X-Spamd-Result: default: False [-0.99 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; RCVD_TLS_ALL(0.00)[]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17]; NEURAL_HAM_LONG(-0.86)[-0.856,0]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; DMARC_NA(0.00)[freebsd.org]; NEURAL_HAM_MEDIUM(-0.96)[-0.958,0]; RWL_MAILSPIKE_GOOD(0.00)[52.218.85.209.rep.mailspike.net : 127.0.0.18]; URI_COUNT_ODD(1.00)[3]; RCPT_COUNT_FIVE(0.00)[6]; RCVD_COUNT_THREE(0.00)[4]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[52.218.85.209.list.dnswl.org : 127.0.5.0]; IP_SCORE(-0.17)[ipnet: 209.85.128.0/17(-0.40), asn: 15169(-0.43), country: US(-0.05)]; FORGED_SENDER(0.30)[erj@freebsd.org,ricera10@gmail.com]; MIME_TRACE(0.00)[0:+,1:+,2:~]; R_DKIM_NA(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; FROM_NEQ_ENVFROM(0.00)[erj@freebsd.org,ricera10@gmail.com] Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 Apr 2020 23:39:49 -0000 On Thu, Apr 9, 2020 at 2:29 PM Eric Joyner wrote: > On Thu, Apr 9, 2020 at 2:02 PM Eric Joyner wrote: > >> On Tue, Apr 7, 2020 at 4:24 PM Mark Johnston wrote: >> >>> I spent some time looking at the core. It looks like we have yet >>> another problem: the gtaskqueue code won't exit the net epoch if it is >>> constantly running a net task. Could you please retry with the patches >>> from before, and this one included? >>> >>> diff --git a/sys/kern/subr_gtaskqueue.c b/sys/kern/subr_gtaskqueue.c >>> index f52f32204644..2b1386a612ee 100644 >>> --- a/sys/kern/subr_gtaskqueue.c >>> +++ b/sys/kern/subr_gtaskqueue.c >>> @@ -345,7 +345,7 @@ gtaskqueue_run_locked(struct gtaskqueue *queue) >>> struct epoch_tracker et; >>> struct gtaskqueue_busy tb; >>> struct gtask *gtask; >>> - bool in_net_epoch; >>> + bool in net_epoch; >>> >>> KASSERT(queue != NULL, ("tq is NULL")); >>> TQ_ASSERT_LOCKED(queue); >>> @@ -361,20 +361,19 @@ gtaskqueue_run_locked(struct gtaskqueue *queue) >>> TQ_UNLOCK(queue); >>> >>> KASSERT(gtask->ta_func != NULL, ("task->ta_func is >>> NULL")); >>> - if (!in_net_epoch && TASK_IS_NET(gtask)) { >>> - in_net_epoch = true; >>> + if (TASK_IS_NET(gtask)) { >>> NET_EPOCH_ENTER(et); >>> - } else if (in_net_epoch && !TASK_IS_NET(gtask)) { >>> + in_net_epoch = true; >>> + } >>> + gtask->ta_func(gtask->ta_context); >>> + if (in_net_epoch) { >>> NET_EPOCH_EXIT(et); >>> in_net_epoch = false; >>> } >>> - gtask->ta_func(gtask->ta_context); >>> >>> TQ_LOCK(queue); >>> wakeup(gtask); >>> } >>> - if (in_net_epoch) >>> - NET_EPOCH_EXIT(et); >>> LIST_REMOVE(&tb, tb_link); >>> } >>> >>> _______________________________________________ >>> freebsd-net@freebsd.org mailing list >>> https://lists.freebsd.org/mailman/listinfo/freebsd-net >>> To unsubscribe, send any mail to "freebsd-net-unsubscribe@freebsd.org" >>> >> >> Yeah, I'll give it a spin and try to get back to you before the end of >> the week. >> >> - Eric >> > > I was able to try it out just now, and it looks this (and all of the other > patches) finally causes the problem to not appear! I can unload the driver > while iavf1 is receiving heavy traffic! > > - Eric > Hi Mark, Are you planning to commit these patches to HEAD? I see the reviews for D24214 and D24215 are still up, and I don't know if you created a review for the patch you put in this email chain. - Eric