From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by dpdk.org (Postfix) with ESMTP id A2DCD4CB3 for ; Wed, 28 Feb 2018 16:49:34 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga007.jf.intel.com ([10.7.209.58]) by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 28 Feb 2018 07:49:33 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.47,406,1515484800"; d="scan'208";a="20964713" Received: from tanjianf-mobl.ccr.corp.intel.com (HELO [10.255.25.28]) ([10.255.25.28]) by orsmga007.jf.intel.com with ESMTP; 28 Feb 2018 07:49:32 -0800 To: "Burakov, Anatoly" , "dev@dpdk.org" References: <31f6d9ef676fb1eb0a664c06d62d66f32876dcb6.1519672713.git.anatoly.burakov@intel.com> <4be9dbc2f5751e9584f69997d4ef0077992eae52.1519740527.git.anatoly.burakov@intel.com> <78e91c1c-2f7f-e93b-4e4b-ef1d77aa1140@intel.com> From: "Tan, Jianfeng" Message-ID: Date: Wed, 28 Feb 2018 23:49:31 +0800 User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 In-Reply-To: <78e91c1c-2f7f-e93b-4e4b-ef1d77aa1140@intel.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [PATCH v3 4/5] eal: prevent secondary process init while sending messages X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Feb 2018 15:49:35 -0000 On 2/28/2018 6:19 PM, Burakov, Anatoly wrote: > On 28-Feb-18 1:58 AM, Tan, Jianfeng wrote: >> Hi Anatoly, >> >>> -----Original Message----- >>> From: Burakov, Anatoly >>> Sent: Tuesday, February 27, 2018 10:36 PM >>> To: dev@dpdk.org >>> Cc: Tan, Jianfeng >>> Subject: [PATCH v3 4/5] eal: prevent secondary process init while >>> sending >>> messages >>> >>> Currently, it is possible to spin up a secondary process while >>> either sendmsg or request is in progress. Fix this by adding >>> directory locks during init, sendmsg and requests. >> >> Could you give a more detailed example for this issue? >> >> And why locking the directory can help? >> >> Thanks, >> Jianfeng >> > > Consider this. You start a request. Since sending this out takes > non-zero amount of time, and you're waiting for process to reply each > time you send a message, there's a non-zero chance where contents of > /var/run may change and another socket file may appear that wasn't > there when we started sending out those messages. OK, I see the issue now. When primary broadcasts a request and another secondary joins, then if that request will be delivered to the new secondary, it's an undefined behavior. > > This is simply making sending requests atomic, if you will. Honestly, > i can't think of a situation where this might be a problem, but it > just doesn't feel right, so i fixed it :) > The way seems a little overkill to me. But I did not find a better way :-) Thanks, Jianfeng