Date: Mon, 6 Aug 2018 10:02:40 +0200 From: Hans Petter Selasky <hps@selasky.org> To: Matthew Macy <mmacy@freebsd.org>, Roman Bogorodskiy <novel@freebsd.org> Cc: freebsd-current@freebsd.org Subject: Re: panic after ifioctl/if_clone_destroy Message-ID: <8acc8f27-29f2-d4c1-7473-f7053b14e7ad@selasky.org> In-Reply-To: <a03803e6-5f1e-1960-c6a1-c7477f0ac9d4@selasky.org> References: <20180805153556.GA1957@kloomba> <CAPrugNqVUoP0V8%2ByKTbCZgMoDu22xvCfUuga2LbKabjyi_=__A@mail.gmail.com> <a03803e6-5f1e-1960-c6a1-c7477f0ac9d4@selasky.org>
next in thread | previous in thread | raw e-mail | index | archive | help
This is a multi-part message in MIME format.
--------------49F70DB08EF10129B2DB182D
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 7bit
Hi Roman,
Can you try the attached patch?
--HPS
--------------49F70DB08EF10129B2DB182D
Content-Type: text/x-patch;
name="epoch.diff"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
filename="epoch.diff"
Index: sys/kern/subr_epoch.c
===================================================================
--- sys/kern/subr_epoch.c (revision 336962)
+++ sys/kern/subr_epoch.c (working copy)
@@ -232,33 +232,14 @@
struct epoch_thread *tdwait;
struct turnstile *ts;
struct lock_object *lock;
- int spincount, gen;
int locksheld __unused;
record = __containerof(cr, struct epoch_record, er_record);
td = curthread;
locksheld = td->td_locks;
- spincount = 0;
counter_u64_add(block_count, 1);
if (record->er_cpuid != curcpu) {
/*
- * If the head of the list is running, we can wait for it
- * to remove itself from the list and thus save us the
- * overhead of a migration
- */
- if ((tdwait = TAILQ_FIRST(&record->er_tdlist)) != NULL &&
- TD_IS_RUNNING(tdwait->et_td)) {
- gen = record->er_gen;
- thread_unlock(td);
- do {
- cpu_spinwait();
- } while (tdwait == TAILQ_FIRST(&record->er_tdlist) &&
- gen == record->er_gen && TD_IS_RUNNING(tdwait->et_td) &&
- spincount++ < MAX_ADAPTIVE_SPIN);
- thread_lock(td);
- return;
- }
- /*
* Being on the same CPU as that of the record on which
* we need to wait allows us access to the thread
* list associated with that CPU. We can then examine the
--------------49F70DB08EF10129B2DB182D--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?8acc8f27-29f2-d4c1-7473-f7053b14e7ad>
