From patchwork Mon Dec 23 17:09:45 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ilya Dryomov X-Patchwork-Id: 3397521 Return-Path: X-Original-To: patchwork-ceph-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id B8BCBC0D4A for ; Mon, 23 Dec 2013 17:11:24 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id B327F2069D for ; Mon, 23 Dec 2013 17:11:23 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 16011205F1 for ; Mon, 23 Dec 2013 17:11:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757692Ab3LWRLJ (ORCPT ); Mon, 23 Dec 2013 12:11:09 -0500 Received: from mail-ea0-f180.google.com ([209.85.215.180]:48128 "EHLO mail-ea0-f180.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757677Ab3LWRLH (ORCPT ); Mon, 23 Dec 2013 12:11:07 -0500 Received: by mail-ea0-f180.google.com with SMTP id f15so2475320eak.11 for ; Mon, 23 Dec 2013 09:11:06 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=LhXeYnyp/jKtMwcBXjVhwSmNVFst483KUFuze6Gq9xg=; b=grpG3LLFuWDbW7bD7leEu4o3lkOMc4/eHyWPM2CKPJClzWtaTgPUrMUaEAelF0+ugI 1bh4DSU2y2WDSwMmFSG9STNd/mM6DVq5oB6T3m/2g2XQOOFT3ZtB8zL65c+MntVDyBKD eAY+OFtAeHdY84dlVbbDYSOyEK4V/IBH1YXtxTrV/vSP4an6aIhDn7U4+e6vPhn6eEpI Tr4TRrfBF8p3ZuUqn5NT2ASlgJVp8+PCoXkSbCc/zo9kvXtyuX+UZefHSvEgDMEDmo2G FVfMKiFWamfx9bgktl2FxCYd3jin8l9BcQ9WxVuosudKD97A6r+S2Bf6GZSG3M8794k5 05iQ== X-Gm-Message-State: ALoCoQkg2IBd9dIjFz+WBoTB+Ss/4nFMPfQFRdTiCes5mgKepus/ZRc3QPGhhqSuV4g6d6Jfsd50 X-Received: by 10.14.219.4 with SMTP id l4mr729082eep.94.1387818666062; Mon, 23 Dec 2013 09:11:06 -0800 (PST) Received: from localhost ([109.110.66.29]) by mx.google.com with ESMTPSA id 4sm47308768eed.14.2013.12.23.09.11.05 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Mon, 23 Dec 2013 09:11:05 -0800 (PST) From: Ilya Dryomov To: ceph-devel@vger.kernel.org Cc: Sage Weil , ilya.dryomov@inktank.com Subject: [PATCH 14/19] crush: add SET_CHOOSE_TRIES rule step Date: Mon, 23 Dec 2013 19:09:45 +0200 Message-Id: <1387818590-30483-15-git-send-email-ilya.dryomov@inktank.com> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1387818590-30483-1-git-send-email-ilya.dryomov@inktank.com> References: <1387818590-30483-1-git-send-email-ilya.dryomov@inktank.com> Sender: ceph-devel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: ceph-devel@vger.kernel.org X-Spam-Status: No, score=-7.4 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Since we can specify the recursive retries in a rule, we may as well also specify the non-recursive tries too for completeness. Reflects ceph.git commit d1b97462cffccc871914859eaee562f2786abfd1. Signed-off-by: Ilya Dryomov --- include/linux/crush/crush.h | 3 ++- net/ceph/crush/mapper.c | 5 +++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/include/linux/crush/crush.h b/include/linux/crush/crush.h index 07b8fd4f81fc..5f95969347ec 100644 --- a/include/linux/crush/crush.h +++ b/include/linux/crush/crush.h @@ -47,7 +47,8 @@ enum { CRUSH_RULE_CHOOSE_LEAF_FIRSTN = 6, CRUSH_RULE_CHOOSE_LEAF_INDEP = 7, - CRUSH_RULE_SET_CHOOSE_LEAF_TRIES = 9, + CRUSH_RULE_SET_CHOOSE_TRIES = 8, /* override choose_total_tries */ + CRUSH_RULE_SET_CHOOSE_LEAF_TRIES = 9, /* override chooseleaf_descend_once */ }; /* diff --git a/net/ceph/crush/mapper.c b/net/ceph/crush/mapper.c index c34320518c8b..a1acdea935bf 100644 --- a/net/ceph/crush/mapper.c +++ b/net/ceph/crush/mapper.c @@ -661,6 +661,11 @@ int crush_do_rule(const struct crush_map *map, wsize = 1; break; + case CRUSH_RULE_SET_CHOOSE_TRIES: + if (curstep->arg1 > 0) + choose_tries = curstep->arg1; + break; + case CRUSH_RULE_SET_CHOOSE_LEAF_TRIES: if (curstep->arg1 > 0) choose_leaf_tries = curstep->arg1;