From: mathieu.desnoyers@efficios.com (Mathieu Desnoyers)
Subject: [lttng-dev] might_sleep warnings in overwrite mode
Date: Fri, 15 Nov 2013 02:34:09 +0000 (UTC) [thread overview]
Message-ID: <67652521.68027.1384482849638.JavaMail.zimbra@efficios.com> (raw)
In-Reply-To: <52851395.3010306@mentor.com>
----- Original Message -----
> From: "Nathan Lynch" <Nathan_Lynch@mentor.com>
> To: lttng-dev at lists.lttng.org
> Sent: Thursday, November 14, 2013 1:16:53 PM
> Subject: Re: [lttng-dev] might_sleep warnings in overwrite mode
>
> On 11/10/2013 08:18 PM, Nathan Lynch wrote:
> > At this point I cannot trigger the issue without overwrite mode on
> > 3.11.6, but on a 3.8-based vendor kernel I can recreate it regardless of
> > the mode.
>
> Some updates on this:
> - It's not specific to overwrite mode; I was able to provoke it on
> 3.11.6 without --overwrite. Overwrite mode does seem to recreate the
> issue more readily.
> - It seems to be GCC version-dependent. 4.8.1 and 4.8.2 produce code
> which warns/bugs; 4.7.3 does not.
Allright! This info is really useful. Sorry for taking time to look into this, I was busy with preparation for 2.4-rc1.
Looking at:
fs/ext3/incode.c:
__ext3_get_inode_loc()
we can see that a use of the inlined sb_getblk() appears close to a tracepoint.
The tracepoint includes preempt disable/enable, exactly those:
include/linux/preempt.h:
#define preempt_disable_notrace() \
do { \
inc_preempt_count_notrace(); \
barrier(); \
} while (0)
#define preempt_enable_notrace() \
do { \
preempt_enable_no_resched_notrace(); \
barrier(); \
preempt_check_resched_context(); \
} while (0)
Can you try wrapping the _outside_ of those macros with barrier(), e.g.
#define preempt_disable_notrace() \
do { \
barrier(); \
inc_preempt_count_notrace(); \
barrier(); \
} while (0)
#define preempt_enable_notrace() \
do { \
preempt_enable_no_resched_notrace(); \
barrier(); \
preempt_check_resched_context(); \
barrier(); \
} while (0)
and try it out with the apparently buggy compiler to see if it helps ? It does look like the preempt inc or dec is slipping out and somehow triggers the might_sleep() warning. I don't see clearly how this could happen yet, since each of the inc/dec and the test are touching preempt_count(), but it's worth a try.
Maybe on ARM the current_thread_info() macro somehow hides important info from the compiler and it mistakenly reorders inc/dec vs the test. Another thing to try out (in addition to the first one) would be to try changing current_thread_info(), e.g., by turning asm ("sp") into a volatile inline assembly, and by adding "memory" clobbers to it.
Thoughts ?
Thanks,
Mathieu
>
>
>
> _______________________________________________
> lttng-dev mailing list
> lttng-dev at lists.lttng.org
> http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev
>
--
Mathieu Desnoyers
EfficiOS Inc.
http://www.efficios.com
next prev parent reply other threads:[~2013-11-15 2:34 UTC|newest]
Thread overview: 37+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-11-11 2:18 Nathan Lynch
2013-11-11 15:47 ` Nathan Lynch
2013-11-14 18:16 ` Nathan Lynch
2013-11-15 2:34 ` Mathieu Desnoyers [this message]
2013-11-18 19:30 ` Nathan Lynch
2013-11-19 15:29 ` [lttng-dev] current_thread_info() not respecting program order with gcc 4.8.x Mathieu Desnoyers
2013-11-19 15:57 ` Peter Zijlstra
2013-11-19 16:13 ` Jakub Jelinek
2013-11-19 16:21 ` Peter Zijlstra
2013-11-19 16:05 ` Will Deacon
2013-11-19 17:02 ` Mathieu Desnoyers
2013-11-19 17:33 ` Peter Zijlstra
2013-11-19 21:56 ` [lttng-dev] Multiple local register variables w/ same register Richard Henderson
2013-11-19 22:08 ` Jakub Jelinek
2013-11-19 22:13 ` Måns Rullgård
2013-11-19 22:25 ` Mathieu Desnoyers
2013-11-19 22:34 ` Mathieu Desnoyers
2013-11-20 0:41 ` [lttng-dev] current_thread_info() not respecting program order with gcc 4.8.x Linus Torvalds
2013-11-20 15:10 ` Mathieu Desnoyers
2013-11-21 16:02 ` Alexander Holler
2013-11-21 22:12 ` Luis Lozano
2013-11-21 22:32 ` Linus Torvalds
2013-11-21 23:03 ` Bhaskar Janakiraman
2013-11-21 23:18 ` Alexander Holler
2013-11-21 23:45 ` Luis Lozano
2013-11-22 0:39 ` Jakub Jelinek
2013-11-22 1:57 ` Mathieu Desnoyers
2013-11-22 2:36 ` Luis Lozano
2013-11-22 3:38 ` Mathieu Desnoyers
2013-11-22 8:16 ` Luis Lozano
2013-11-22 13:02 ` Mathieu Desnoyers
2013-11-22 8:18 ` Luis Lozano
2013-11-22 8:33 ` Luis Lozano
2013-11-22 13:06 ` Mathieu Desnoyers
2013-11-22 20:33 ` Mathieu Desnoyers
2013-11-22 0:17 ` Linus Torvalds
2013-11-22 0:34 ` Alexander Holler
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=67652521.68027.1384482849638.JavaMail.zimbra@efficios.com \
--to=mathieu.desnoyers@efficios.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox