From patchwork Tue Jan 17 04:39:32 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Mahoney X-Patchwork-Id: 9519925 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 6A0D160442 for ; Tue, 17 Jan 2017 04:39:51 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5EE6028174 for ; Tue, 17 Jan 2017 04:39:51 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4FF5A2849B; Tue, 17 Jan 2017 04:39:51 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 79B4E283B4 for ; Tue, 17 Jan 2017 04:39:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751171AbdAQEjm (ORCPT ); Mon, 16 Jan 2017 23:39:42 -0500 Received: from mx2.suse.de ([195.135.220.15]:36271 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751166AbdAQEjm (ORCPT ); Mon, 16 Jan 2017 23:39:42 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id DFFA6AC88 for ; Tue, 17 Jan 2017 04:39:40 +0000 (UTC) Received: by starscream.home.jeffm.io (Postfix, from userid 1000) id DC3F48BA8A; Mon, 16 Jan 2017 23:39:37 -0500 (EST) From: jeffm@suse.com To: linux-xfs@vger.kernel.org Cc: Jeff Mahoney Subject: [PATCH 2/3] xfs_repair: add prefetch trace calls to debug thread creation failures Date: Mon, 16 Jan 2017 23:39:32 -0500 Message-Id: <1484627973-11535-3-git-send-email-jeffm@suse.com> X-Mailer: git-send-email 2.7.1 In-Reply-To: <1484627973-11535-1-git-send-email-jeffm@suse.com> References: <1484627973-11535-1-git-send-email-jeffm@suse.com> Sender: linux-xfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-xfs@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Jeff Mahoney When debugging prefetch failures, it's useful to have thread creation failure messages that are output as warnings on stderr in the trace log as well. It's also helpful to see when an AG gets queued behind another one rather than having the thread started directly, which has a separate trace line. Signed-off-by: Jeff Mahoney Reviewed-by: Eric Sandeen --- repair/prefetch.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/repair/prefetch.c b/repair/prefetch.c index 044fab2..37d60d6 100644 --- a/repair/prefetch.c +++ b/repair/prefetch.c @@ -703,6 +703,8 @@ pf_queuing_worker( if (err != 0) { do_warn(_("failed to create prefetch thread: %s\n"), strerror(err)); + pftrace("failed to create prefetch thread for AG %d: %s", + args->agno, strerror(err)); args->io_threads[i] = 0; if (i == 0) { pf_start_processing(args); @@ -817,6 +819,8 @@ pf_create_prefetch_thread( if (err != 0) { do_warn(_("failed to create prefetch thread: %s\n"), strerror(err)); + pftrace("failed to create prefetch thread for AG %d: %s", + args->agno, strerror(err)); args->queuing_thread = 0; cleanup_inode_prefetch(args); } @@ -882,8 +886,11 @@ start_inode_prefetch( if (prev_args->prefetch_done) { if (!pf_create_prefetch_thread(args)) args = NULL; - } else + } else { prev_args->next_args = args; + pftrace("queued AG %d after AG %d", + args->agno, prev_args->agno); + } pthread_mutex_unlock(&prev_args->lock); }