From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from [87.239.111.99] (localhost [127.0.0.1]) by dev.tarantool.org (Postfix) with ESMTP id 94AD46EC5F; Tue, 2 Mar 2021 01:23:15 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 94AD46EC5F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1614637395; bh=l9V8VNSiJ5JB/EVHCfCVHpYIArYboFN2IiH7vxEPqMc=; h=To:Date:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=Io2xLPIQ0WHApt7hKGAvmfaphTVAqJcdx8W8S4aeonJ5/ENf+9obh+CLcE/0z7bPw tCyfaSfLjE6xzw8DbC4CBpXnRRmwZAveuOo1li+s8RE4GZHc4b0p346ZVolwgGhOKJ 3jZEKvGoD78HF+reNg5UYjxhHZZ1EA7oTe6UUy2Q= Received: from smtpng3.m.smailru.net (smtpng3.m.smailru.net [94.100.177.149]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dev.tarantool.org (Postfix) with ESMTPS id E152D6EC5F for ; Tue, 2 Mar 2021 01:23:14 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org E152D6EC5F Received: by smtpng3.m.smailru.net with esmtpa (envelope-from ) id 1lGqwc-0006MT-8R; Tue, 02 Mar 2021 01:23:14 +0300 To: tarantool-patches@dev.tarantool.org, sergepetrenko@tarantool.org, gorcunov@gmail.com Date: Mon, 1 Mar 2021 23:23:13 +0100 Message-Id: <2ba579eef6f31d17a1670a6eaf31492366963ad9.1614637331.git.v.shpilevoy@tarantool.org> X-Mailer: git-send-email 2.24.3 (Apple Git-128) MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-7564579A: 78E4E2B564C1792B X-77F55803: 4F1203BC0FB41BD92A98208ECBDD29F51A014079BC0C7C459F7160AC7246F773182A05F538085040B3C18DE4D64DC870BFB82E66BA2F0DCF3817DDA1937BB60784ADCEE68B241C65 X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE7D6964C9E324ABA58EA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F79006376602C647E39EFA3A8638F802B75D45FF5571747095F342E8C7A0BC55FA0FE5FCF59B2E660736A58C41BBD1B88A573EC6C927F6A94233E16C389733CBF5DBD5E913377AFFFEAFD269176DF2183F8FC7C0C8FBEF6EAD8577B08941B15DA834481FCF19DD082D7633A0EF3E4896CB9E6436389733CBF5DBD5E9D5E8D9A59859A8B6505D71D783575ABECC7F00164DA146DA6F5DAA56C3B73B23C77107234E2CFBA567F23339F89546C55F5C1EE8F4F765FC08F9A42B2210255C75ECD9A6C639B01BBD4B6F7A4D31EC0BC0CAF46E325F83A522CA9DD8327EE4930A3850AC1BE2E73589C8E7BF4648B176C4224003CC836476C0CAF46E325F83A50BF2EBBBDD9D6B0F347543BADC64E7283B503F486389A921A5CC5B56E945C8DA X-C1DE0DAB: C20DE7B7AB408E4181F030C43753B8186998911F362727C414F749A5E30D975C25752893F242F32C1EAE2563D7A967CBBAD1E22582E0D1639C2B6934AE262D3EE7EAB7254005DCEDB83465427F80716C1E0A4E2319210D9B64D260DF9561598F01A9E91200F654B0CCA28C6D779E2CD78E8E86DC7131B365E7726E8460B7C23C X-C8649E89: 4E36BF7865823D7055A7F0CF078B5EC49A30900B95165D34EE6683D9E546CC6251AEA91A1E2817D810077361C864B0646F2D75606A50155610386BD51515DA881D7E09C32AA3244C2693596C5FC3D314E6239F5F838C9DDFA95CA90A1D8AC565FACE5A9C96DEB163 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2biojnpKwxR6GFbt2EYNCQdfSxw== X-Mailru-Sender: 689FA8AB762F73936BC43F508A063822B04CCDA4104A50EC025C046384D058713841015FED1DE5223CC9A89AB576DD93FB559BB5D741EB963CF37A108A312F5C27E8A8C3839CE0E267EA787935ED9F1B X-Mras: Ok Subject: [Tarantool-patches] [PATCH 1/1] fiber_cond: remove rlist_shift usages X-BeenThere: tarantool-patches@dev.tarantool.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Vladislav Shpilevoy via Tarantool-patches Reply-To: Vladislav Shpilevoy Errors-To: tarantool-patches-bounces@dev.tarantool.org Sender: "Tarantool-patches" Fiber_cond to pop fibers from the queue uses rlist_shift() + fiber_wakeup() calls. The shift wasn't needed, because fibers are linked with 'state' member, which is moved by fiber_wakeup() anyway. Closes #5855 --- Branch: http://github.com/tarantool/tarantool/tree/gerold103/gh-5855-optimize-fiber-cond Issue: https://github.com/tarantool/tarantool/issues/5855 src/lib/core/fiber_cond.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib/core/fiber_cond.c b/src/lib/core/fiber_cond.c index 71bb2d04d..3624dffd4 100644 --- a/src/lib/core/fiber_cond.c +++ b/src/lib/core/fiber_cond.c @@ -84,7 +84,7 @@ fiber_cond_signal(struct fiber_cond *e) { if (! rlist_empty(&e->waiters)) { struct fiber *f; - f = rlist_shift_entry(&e->waiters, struct fiber, state); + f = rlist_first_entry(&e->waiters, struct fiber, state); fiber_wakeup(f); } } @@ -94,7 +94,7 @@ fiber_cond_broadcast(struct fiber_cond *e) { while (! rlist_empty(&e->waiters)) { struct fiber *f; - f = rlist_shift_entry(&e->waiters, struct fiber, state); + f = rlist_first_entry(&e->waiters, struct fiber, state); fiber_wakeup(f); } } -- 2.24.3 (Apple Git-128)