Received: by 10.223.164.202 with SMTP id h10csp661969wrb; Wed, 22 Nov 2017 13:15:42 -0800 (PST) X-Google-Smtp-Source: AGs4zMbJD3Ri6eiD6Zf6yE7bxQODNmqWLU4Dncos6xPHSHAyWQRuQAUh4kMTsBpJTWv6XlmRHyS2 X-Received: by 10.84.233.1 with SMTP id j1mr3067073plk.311.1511385342237; Wed, 22 Nov 2017 13:15:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1511385342; cv=none; d=google.com; s=arc-20160816; b=aBojemVxcx8JKgulm4YIMJQ3Lr669hmkaatDphGmWaHLFVs0xy1KRoiEosJUKt1qAH yGmxAm5X/kVMuO+c6aIcnpcnMbAqaDtkIxtH6V1lJKH32/ADJgQx51pfOaCRDwkUSm91 OmZwUqOhEqXToqpM6beJJzI+l8xS5xjxpKzFTY/nhHk4iOmVM5ltuJZymvYo4VE42KAE 3EJHHwWbQSKTpnCPB18/rJQ3HlpSiIOXn/DI7wAohGBTCsZrWY8UWEUDFQR/jMFgCbhv /xlfQ+pA6974H1xHI7H+l81Z7B404fcJ+OLd2WcfDQROynjsRu93hIHUvaprCWE4wA8d ph7Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=iUoEKYNiHXD9QqwAF08pmLiU4TNuVKA5X/CARpYMe30=; b=zvKpSvV/alJEJOHBTOuWHJCZz6R3dROd0dZbzyetURk1Hp4wu16H9HAqY6wZ+hgGjw 16jaj86G0CPkO8WxdUynBMdlF9Xg40JFld7RiqKnz2GUsMN4eY17POit3CXCz5kQEJpJ /igDCzwVhoQRtZa+I1U5sMhv62b0UjL/VD9gd0alSCLGZLNw+LQoo89of6gcGlmr3y4X aujAB5NWcduWu5+hjgT6YniigCNZtdVwPOkW+53lGk4Yn/jWNQ2S1Ip9H9i9Ewqf0DMS evUedR/rPdyvDC4R2lxcTR0PCvyThbkJc6Oy53tz2QbxDVtE53NN6AKbEYtLuoFRqLBw ya+g== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=YKluHH3R; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d8si3144850pgc.736.2017.11.22.13.15.30; Wed, 22 Nov 2017 13:15:42 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=YKluHH3R; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751596AbdKVVMy (ORCPT + 77 others); Wed, 22 Nov 2017 16:12:54 -0500 Received: from bombadil.infradead.org ([65.50.211.133]:48706 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751863AbdKVVIU (ORCPT ); Wed, 22 Nov 2017 16:08:20 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=References:In-Reply-To:Message-Id: Date:Subject:Cc:To:From:Sender:Reply-To:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=iUoEKYNiHXD9QqwAF08pmLiU4TNuVKA5X/CARpYMe30=; b=YKluHH3RHpqeE2q6QwXS2Kdz0 5TxLgscLeT9F17wNm4vOkrbtTokPuobSqR4kcs9nZjf8WVYHGdw0wZP7I9rtQnAwKOiT2bN1P2Zn4 lg4+XjNq2Kk7EVMKIlwUM3U9jCQQ4pRbO64ftbp/Tps90Qz3pGlyh7XecVGScu6njC+YdAa3mhr5X PRK3SsQGlhmlGA6VQb7mYbXUPvrKj148XDy8YHSy+T8wZKYzbLwMWVQK9MXl/DUX5zxvrAsc5ugvc SJW6J0jcqb84zDR8cTPC37s/o0kIuzixcB5Qwsy1fX/JnIiDuIgAzumvZt43We2c8miLcF2KgP0z5 3dp5NUunw==; Received: from willy by bombadil.infradead.org with local (Exim 4.87 #1 (Red Hat Linux)) id 1eHcFn-0007xn-LU; Wed, 22 Nov 2017 21:08:19 +0000 From: Matthew Wilcox To: linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org Cc: Matthew Wilcox Subject: [PATCH 49/62] rxrpc: Remove IDR preloading Date: Wed, 22 Nov 2017 13:07:26 -0800 Message-Id: <20171122210739.29916-50-willy@infradead.org> X-Mailer: git-send-email 2.9.5 In-Reply-To: <20171122210739.29916-1-willy@infradead.org> References: <20171122210739.29916-1-willy@infradead.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Matthew Wilcox The IDR now handles its own locking, so if we remove the locking in rxrpc, we can also remove the memory preloading. Signed-off-by: Matthew Wilcox --- net/rxrpc/conn_client.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/net/rxrpc/conn_client.c b/net/rxrpc/conn_client.c index 7e8bf10fec86..d61fbd359bfa 100644 --- a/net/rxrpc/conn_client.c +++ b/net/rxrpc/conn_client.c @@ -91,7 +91,6 @@ __read_mostly unsigned int rxrpc_conn_idle_client_fast_expiry = 2 * HZ; /* * We use machine-unique IDs for our client connections. */ -static DEFINE_SPINLOCK(rxrpc_conn_id_lock); int rxrpc_client_conn_cursor; DEFINE_IDR(rxrpc_client_conn_ids); @@ -111,12 +110,8 @@ static int rxrpc_get_client_connection_id(struct rxrpc_connection *conn, _enter(""); - idr_preload(gfp); - spin_lock(&rxrpc_conn_id_lock); id = idr_alloc_cyclic(&rxrpc_client_conn_ids, &rxrpc_client_conn_cursor, - conn, 1, 0x40000000, GFP_NOWAIT); - spin_unlock(&rxrpc_conn_id_lock); - idr_preload_end(); + conn, 1, 0x40000000, gfp); if (id < 0) goto error; @@ -137,10 +132,8 @@ static int rxrpc_get_client_connection_id(struct rxrpc_connection *conn, static void rxrpc_put_client_connection_id(struct rxrpc_connection *conn) { if (test_bit(RXRPC_CONN_HAS_IDR, &conn->flags)) { - spin_lock(&rxrpc_conn_id_lock); idr_remove(&rxrpc_client_conn_ids, conn->proto.cid >> RXRPC_CIDSHIFT); - spin_unlock(&rxrpc_conn_id_lock); } } -- 2.15.0 From 1584802958113065220@xxx Wed Nov 22 21:24:37 +0000 2017 X-GM-THRID: 1584802958113065220 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread