Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1589436
| From | Peter Zijlstra <peterz@infradead.org> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH v5 06/13] lockdep: Implement crossrelease feature |
| Date | 2017-02-28 14:20 +0100 |
| Message-ID | <tfPR8-4Up-21@gated-at.bofh.it> (permalink) |
| References | <t0YjD-4z4-5@gated-at.bofh.it> <t0Ytl-4D1-41@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
On Wed, Jan 18, 2017 at 10:17:32PM +0900, Byungchul Park wrote:
> +#define MAX_XHLOCKS_NR 64UL
> +#ifdef CONFIG_LOCKDEP_CROSSRELEASE
> + if (tsk->xhlocks) {
> + void *tmp = tsk->xhlocks;
> + /* Disable crossrelease for current */
> + tsk->xhlocks = NULL;
> + vfree(tmp);
> + }
> +#endif
> +#ifdef CONFIG_LOCKDEP_CROSSRELEASE
> + p->xhlock_idx = 0;
> + p->xhlock_idx_soft = 0;
> + p->xhlock_idx_hard = 0;
> + p->xhlock_idx_nmi = 0;
> + p->xhlocks = vzalloc(sizeof(struct hist_lock) * MAX_XHLOCKS_NR);
I don't think we need vmalloc for this now.
> + p->work_id = 0;
> +#endif
> +#ifdef CONFIG_LOCKDEP_CROSSRELEASE
> + if (p->xhlocks) {
> + void *tmp = p->xhlocks;
> + /* Diable crossrelease for current */
> + p->xhlocks = NULL;
> + vfree(tmp);
> + }
> +#endif
Second instance of the same code, which would suggest using a function
for this. Also, with a function you can loose the #ifdeffery.
Back to linux.kernel | Previous | Next — Next in thread | Find similar | Unroll thread
Re: [PATCH v5 06/13] lockdep: Implement crossrelease feature Peter Zijlstra <peterz@infradead.org> - 2017-02-28 14:20 +0100
Re: [PATCH v5 06/13] lockdep: Implement crossrelease feature Byungchul Park <byungchul.park@lge.com> - 2017-02-28 14:30 +0100
Re: [PATCH v5 06/13] lockdep: Implement crossrelease feature Peter Zijlstra <peterz@infradead.org> - 2017-02-28 14:40 +0100
Re: [PATCH v5 06/13] lockdep: Implement crossrelease feature Byungchul Park <byungchul.park@lge.com> - 2017-02-28 15:10 +0100
csiph-web