Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1589436
| Path | csiph.com!news.mixmin.net!aioe.org!news.servidellagleba.it!bofh.it!news.nic.it!robomod |
|---|---|
| From | Peter Zijlstra <peterz@infradead.org> |
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH v5 06/13] lockdep: Implement crossrelease feature |
| Date | Tue, 28 Feb 2017 14:20:02 +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> |
| X-Original-To | Byungchul Park <byungchul.park@lge.com> |
| Dkim-Signature | v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=q6HAMRzifhRDHStcw+rfXthgF5arxg9SBrYTH8y6xzg=; b=qoA32NQ52B5YdeLmGwrgbdieQ QdV8/0zqcgyHzn78U+FaMHC6DjHayJy7Zy7NUqakbrxK64tKDRbCKv0P9E4aaRVBCBuAxRmMKPUsN BjxbEXqkhAjKNRWTY5vWSOYz87vFmQtMTRwH+Z775mP6j2m88tb7WNfjN/wFY5EpQCU/9tHhKd5+N NzAY7ZA5Lyb1Uhi6u9SS5AS3vp+XK4zAxKGgTvBoXjrOiAZUzVGmUfQy6y5SwV3WSdCznPVexz7DO KIPiP0QNJeK61zAc5zdb1qRCYQIFj5KsiwSdpO7H5h4HWrhpQX5TQMOIOy5u85Zy5IfocSh/NYTVD nL/iMOEng==; |
| MIME-Version | 1.0 |
| Content-Type | text/plain; charset=us-ascii |
| Content-Disposition | inline |
| User-Agent | Mutt/1.5.22.1 (2013-10-16) |
| Sender | robomod@news.nic.it |
| List-ID | <linux-kernel.vger.kernel.org> |
| X-Mailing-List | linux-kernel@vger.kernel.org |
| Approved | robomod@news.nic.it |
| Lines | 35 |
| Organization | linux.* mail to news gateway |
| X-Original-Cc | mingo@kernel.org, tglx@linutronix.de, walken@google.com, boqun.feng@gmail.com, kirill@shutemov.name, linux-kernel@vger.kernel.org, linux-mm@kvack.org, iamjoonsoo.kim@lge.com, akpm@linux-foundation.org, npiggin@gmail.com |
| X-Original-Date | Tue, 28 Feb 2017 14:05:13 +0100 |
| X-Original-Message-ID | <20170228130513.GH5680@worktop> |
| X-Original-References | <1484745459-2055-1-git-send-email-byungchul.park@lge.com> <1484745459-2055-7-git-send-email-byungchul.park@lge.com> |
| X-Original-Sender | linux-kernel-owner@vger.kernel.org |
| Xref | csiph.com linux.kernel:1589436 |
Show key headers only | View raw
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