From mboxrd@z Thu Jan 1 00:00:00 1970 From: Richard Guy Briggs Subject: [ARCHIVE DEBUG 10/13] audit_debug: bark on impossible reserve process conditions in while loop Date: Thu, 22 Oct 2015 14:58:56 -0400 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: In-Reply-To: References: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linux-audit-bounces@redhat.com Errors-To: linux-audit-bounces@redhat.com To: linux-audit@redhat.com Cc: Richard Guy Briggs List-Id: linux-audit@redhat.com Debug the expected impossibility of the audit_backlog_queue reserve being used up. Signed-off-by: Richard Guy Briggs --- kernel/audit.c | 12 ++++++++++++ 1 files changed, 12 insertions(+), 0 deletions(-) diff --git a/kernel/audit.c b/kernel/audit.c index d6f4763..9e9c02b 100644 --- a/kernel/audit.c +++ b/kernel/audit.c @@ -1527,6 +1527,12 @@ struct audit_buffer *audit_log_start(struct audit_context *ctx, gfp_t gfp_mask, atomic_inc(&audit_overflows); overflow_counted = 1; } + if (reserve) { + pr_warn("( %lu %lu )" + " Qstuck apid=%d pid=%d comm=%s type=%d reserve=%d Qlen=%d\n", + timeout_start, jiffies-timeout_start, + audit_pid, current->pid, current->comm, type, reserve, skb_queue_len(&audit_skb_queue)); + } if (gfp_mask & __GFP_WAIT && audit_backlog_wait_time) { long sleep_time; @@ -1534,6 +1540,12 @@ struct audit_buffer *audit_log_start(struct audit_context *ctx, gfp_t gfp_mask, atomic_inc(&audit_waiters); waiter = 1; } + if (reserve) { + pr_warn("( %lu %lu )" + " Qreallystuck apid=%d pid=%d comm=%s type=%d reserve=%d Qlen=%d\n", + timeout_start, jiffies-timeout_start, + audit_pid, current->pid, current->comm, type, reserve, skb_queue_len(&audit_skb_queue)); + } sleep_time = timeout_start + audit_backlog_wait_time - jiffies; if (sleep_time > 0) { sleep_time = wait_for_auditd(sleep_time); -- 1.7.1