From owner-svn-src-all@freebsd.org Fri Jul 5 15:49:22 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2EF3415CE50E; Fri, 5 Jul 2019 15:49:22 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C8A4875686; Fri, 5 Jul 2019 15:49:21 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from John-Baldwins-MacBook-Pro-4.local (ralph.baldwin.cx [66.234.199.215]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) (Authenticated sender: jhb) by smtp.freebsd.org (Postfix) with ESMTPSA id 3BF571F096; Fri, 5 Jul 2019 15:49:20 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Subject: Re: svn commit: r349763 - in stable/12/sys: kern sys To: Hans Petter Selasky , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org References: <201907051226.x65CQUev056366@repo.freebsd.org> From: John Baldwin Openpgp: preference=signencrypt Autocrypt: addr=jhb@FreeBSD.org; keydata= mQGiBETQ+XcRBADMFybiq69u+fJRy/0wzqTNS8jFfWaBTs5/OfcV7wWezVmf9sgwn8TW0Dk0 c9MBl0pz+H01dA2ZSGZ5fXlmFIsee1WEzqeJzpiwd/pejPgSzXB9ijbLHZ2/E0jhGBcVy5Yo /Tw5+U/+laeYKu2xb0XPvM0zMNls1ah5OnP9a6Ql6wCgupaoMySb7DXm2LHD1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3hpoDtoK70ioIAjjH aIXIAcm3FGZFXy503DOA0KaTWwvOVdYCFLm3zWuSOmrX/GsEc7ovasOWwjPn878qVjbUKWwx Q4QkF4OhUV9zPtf9tDSAZ3x7QSwoKbCoRCZ/xbyTUPyQ1VvNy/mYrBcYlzHodsaqUDjHuW+I SQQYEQIACQUCRND5ggIbDAAKCRBy3lIGd+N/BCO8AJ9j1dWVQWxw/YdTbEyrRKOY8YZNwwCf afMAg8QvmOWnHx3wl8WslCaXaE8= Message-ID: <97b7657c-53b9-f3d2-f31a-5e56343da71d@FreeBSD.org> Date: Fri, 5 Jul 2019 08:49:19 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:60.0) Gecko/20100101 Thunderbird/60.7.0 MIME-Version: 1.0 In-Reply-To: <201907051226.x65CQUev056366@repo.freebsd.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: C8A4875686 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.81 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.81)[-0.809,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Jul 2019 15:49:22 -0000 On 7/5/19 5:26 AM, Hans Petter Selasky wrote: > Author: hselasky > Date: Fri Jul 5 12:26:30 2019 > New Revision: 349763 > URL: https://svnweb.freebsd.org/changeset/base/349763 > > Log: > MFC r340404, r340415, r340417, r340419 and r340420: > Synchronize epoch(9) code with -head to make merging new patches > and features easier. > The FreeBSD version has been bumped to force recompilation of > external kernel modules. > > Sponsored by: Mellanox Technologies > > MFC r340404: > Uninline epoch(9) entrance and exit. There is no proof that modern > processors would benefit from avoiding a function call, but bloating > code. In fact, clang created an uninlined real function for many > object files in the network stack. > > - Move epoch_private.h into subr_epoch.c. Code copied exactly, avoiding > any changes, including style(9). > - Remove private copies of critical_enter/exit. > > Reviewed by: kib, jtl > Differential Revision: https://reviews.freebsd.org/D17879 > > MFC r340415: > The dualism between epoch_tracker and epoch_thread is fragile and > unnecessary. So, expose CK types to kernel and use a single normal > structure for epoch_tracker. > > Reviewed by: jtl, gallatin > > MFC r340417: > With epoch not inlined, there is no point in using _lite KPI. While here, > remove some unnecessary casts. > > MFC r340419: > style(9), mostly adjusting overly long lines. > > MFC r340420: > epoch(9) revert r340097 - no longer a need for multiple sections per cpu > > I spoke with Samy Bahra and recent changes to CK to make ck_epoch_call and > ck_epoch_poll not modify the record have eliminated the need for this. How does this not break the module KBI? You've removed epoch_*_KBI symbols used by existing modules, and you appear to have changed the size of the 'struct epoch_tracker' object that existing modules allocate on the stack and pass to functions in the kernel. Bumping __FreeBSD_version is not sufficient cover to break the KBI of widely used interfaces in stable (while we don't enforce KBI for all parts of the kernel, locking primitives is one of the things we can't break). > Modified: stable/12/sys/sys/epoch.h > ============================================================================== > --- stable/12/sys/sys/epoch.h Fri Jul 5 10:31:37 2019 (r349762) > +++ stable/12/sys/sys/epoch.h Fri Jul 5 12:26:30 2019 (r349763) > @@ -29,10 +29,17 @@ > > #ifndef _SYS_EPOCH_H_ > #define _SYS_EPOCH_H_ > + > +struct epoch_context { > + void *data[2]; > +} __aligned(sizeof(void *)); > + > +typedef struct epoch_context *epoch_context_t; > + > #ifdef _KERNEL > #include > #include > -#endif > +#include > > struct epoch; > typedef struct epoch *epoch_t; > @@ -43,22 +50,19 @@ typedef struct epoch *epoch_t; > extern epoch_t global_epoch; > extern epoch_t global_epoch_preempt; > > -struct epoch_context { > - void *data[2]; > -} __aligned(sizeof(void *)); > - > -typedef struct epoch_context *epoch_context_t; > - > - > struct epoch_tracker { > - void *datap[3]; > -#ifdef EPOCH_TRACKER_DEBUG > - int datai[5]; > -#else > - int datai[1]; > +#ifdef EPOCH_TRACKER_DEBUG > +#define EPOCH_MAGIC0 0xFADECAFEF00DD00D > +#define EPOCH_MAGIC1 0xBADDBABEDEEDFEED > + uint64_t et_magic_pre; > #endif > + TAILQ_ENTRY(epoch_tracker) et_link; > + struct thread *et_td; > + ck_epoch_section_t et_section; > +#ifdef EPOCH_TRACKER_DEBUG > + uint64_t et_magic_post; > +#endif > } __aligned(sizeof(void *)); > - > typedef struct epoch_tracker *epoch_tracker_t; > > epoch_t epoch_alloc(int flags); > @@ -68,26 +72,15 @@ void epoch_wait_preempt(epoch_t epoch); > void epoch_call(epoch_t epoch, epoch_context_t ctx, void (*callback) (epoch_context_t)); > int in_epoch(epoch_t epoch); > int in_epoch_verbose(epoch_t epoch, int dump_onfail); > -#ifdef _KERNEL > DPCPU_DECLARE(int, epoch_cb_count); > DPCPU_DECLARE(struct grouptask, epoch_cb_task); > #define EPOCH_MAGIC0 0xFADECAFEF00DD00D > #define EPOCH_MAGIC1 0xBADDBABEDEEDFEED > > -void epoch_enter_preempt_KBI(epoch_t epoch, epoch_tracker_t et); > -void epoch_exit_preempt_KBI(epoch_t epoch, epoch_tracker_t et); > -void epoch_enter_KBI(epoch_t epoch); > -void epoch_exit_KBI(epoch_t epoch); > +void epoch_enter_preempt(epoch_t epoch, epoch_tracker_t et); > +void epoch_exit_preempt(epoch_t epoch, epoch_tracker_t et); > +void epoch_enter(epoch_t epoch); > +void epoch_exit(epoch_t epoch); > > - > -#if defined(KLD_MODULE) && !defined(KLD_TIED) > -#define epoch_enter_preempt(e, t) epoch_enter_preempt_KBI((e), (t)) > -#define epoch_exit_preempt(e, t) epoch_exit_preempt_KBI((e), (t)) > -#define epoch_enter(e) epoch_enter_KBI((e)) > -#define epoch_exit(e) epoch_exit_KBI((e)) > -#else > -#include > -#endif /* KLD_MODULE */ > - > -#endif /* _KERNEL */ > -#endif > +#endif /* _KERNEL */ > +#endif /* _SYS_EPOCH_H_ */ > -- John Baldwin