From patchwork Thu Feb 27 21:14:20 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Simmons X-Patchwork-Id: 11410349 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 5EDAE92A for ; Thu, 27 Feb 2020 21:35:45 +0000 (UTC) Received: from pdx1-mailman02.dreamhost.com (pdx1-mailman02.dreamhost.com [64.90.62.194]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 4621024677 for ; Thu, 27 Feb 2020 21:35:45 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4621024677 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lustre-devel-bounces@lists.lustre.org Received: from pdx1-mailman02.dreamhost.com (localhost [IPv6:::1]) by pdx1-mailman02.dreamhost.com (Postfix) with ESMTP id 44E64348BED; Thu, 27 Feb 2020 13:29:57 -0800 (PST) X-Original-To: lustre-devel@lists.lustre.org Delivered-To: lustre-devel-lustre.org@pdx1-mailman02.dreamhost.com Received: from smtp3.ccs.ornl.gov (smtp3.ccs.ornl.gov [160.91.203.39]) by pdx1-mailman02.dreamhost.com (Postfix) with ESMTP id 42B6321FBE7 for ; Thu, 27 Feb 2020 13:20:20 -0800 (PST) Received: from star.ccs.ornl.gov (star.ccs.ornl.gov [160.91.202.134]) by smtp3.ccs.ornl.gov (Postfix) with ESMTP id E29378ABF; Thu, 27 Feb 2020 16:18:17 -0500 (EST) Received: by star.ccs.ornl.gov (Postfix, from userid 2004) id E192246A; Thu, 27 Feb 2020 16:18:17 -0500 (EST) From: James Simmons To: Andreas Dilger , Oleg Drokin , NeilBrown Date: Thu, 27 Feb 2020 16:14:20 -0500 Message-Id: <1582838290-17243-393-git-send-email-jsimmons@infradead.org> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1582838290-17243-1-git-send-email-jsimmons@infradead.org> References: <1582838290-17243-1-git-send-email-jsimmons@infradead.org> Subject: [lustre-devel] [PATCH 392/622] lustre: lu_object: Add missed qos_rr_init X-BeenThere: lustre-devel@lists.lustre.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "For discussing Lustre software development." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Lustre Development List MIME-Version: 1.0 Errors-To: lustre-devel-bounces@lists.lustre.org Sender: "lustre-devel" From: Patrick Farrell The new lmv space hash code uses the lu_qos_rr struct, but forgot to init it fully. Specifically, the spin lock isn't inited, causing failures. WC-bug-id: https://jira.whamcloud.com/browse/LU-12538 Lustre-commit: 5e6a30cc2f34 ("LU-12538 lod: Add missed qos_rr_init") Signed-off-by: Patrick Farrell Reviewed-on: https://review.whamcloud.com/35490 Reviewed-by: Andreas Dilger Reviewed-by: Lai Siyao Signed-off-by: James Simmons --- fs/lustre/include/lu_object.h | 1 + fs/lustre/lmv/lmv_obd.c | 3 ++- fs/lustre/obdclass/lu_qos.c | 7 +++++++ 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/fs/lustre/include/lu_object.h b/fs/lustre/include/lu_object.h index 6b1064a..d2e84a3 100644 --- a/fs/lustre/include/lu_object.h +++ b/fs/lustre/include/lu_object.h @@ -1388,6 +1388,7 @@ struct lu_qos { lq_reset:1; /* zero current penalties */ }; +void lu_qos_rr_init(struct lu_qos_rr *lqr); int lqos_add_tgt(struct lu_qos *qos, struct lu_tgt_desc *ltd); int lqos_del_tgt(struct lu_qos *qos, struct lu_tgt_desc *ltd); u64 lu_prandom_u64_max(u64 ep_ro); diff --git a/fs/lustre/lmv/lmv_obd.c b/fs/lustre/lmv/lmv_obd.c index ae799db..e9f9c36 100644 --- a/fs/lustre/lmv/lmv_obd.c +++ b/fs/lustre/lmv/lmv_obd.c @@ -1295,13 +1295,14 @@ static int lmv_setup(struct obd_device *obd, struct lustre_cfg *lcfg) INIT_LIST_HEAD(&lmv->lmv_qos.lq_svr_list); init_rwsem(&lmv->lmv_qos.lq_rw_sem); lmv->lmv_qos.lq_dirty = 1; - lmv->lmv_qos.lq_rr.lqr_dirty = 1; lmv->lmv_qos.lq_reset = 1; /* Default priority is toward free space balance */ lmv->lmv_qos.lq_prio_free = 232; /* Default threshold for rr (roughly 17%) */ lmv->lmv_qos.lq_threshold_rr = 43; + lu_qos_rr_init(&lmv->lmv_qos.lq_rr); + /* * initialize rr_index to lower 32bit of netid, so that client * can distribute subdirs evenly from the beginning. diff --git a/fs/lustre/obdclass/lu_qos.c b/fs/lustre/obdclass/lu_qos.c index 9fdcbc2..d4803e8 100644 --- a/fs/lustre/obdclass/lu_qos.c +++ b/fs/lustre/obdclass/lu_qos.c @@ -42,6 +42,13 @@ #include #include +void lu_qos_rr_init(struct lu_qos_rr *lqr) +{ + spin_lock_init(&lqr->lqr_alloc); + lqr->lqr_dirty = 1; +} +EXPORT_SYMBOL(lu_qos_rr_init); + /** * Add a new target to Quality of Service (QoS) target table. *