From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751275AbdJDWH0 (ORCPT ); Wed, 4 Oct 2017 18:07:26 -0400 Received: from mail-qt0-f179.google.com ([209.85.216.179]:44554 "EHLO mail-qt0-f179.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751174AbdJDWHZ (ORCPT ); Wed, 4 Oct 2017 18:07:25 -0400 X-Google-Smtp-Source: AOwi7QBHqETqUVpo3TFAOhunuHsJ/LRB9mep+NAnUKkJaxBRkq1HYp0aRtYFFEi9QAYoLnjzD5GRZQ== Subject: Re: [PATCHv2 1/1] [tools]: android/ion: userspace test utility for ion buffer sharing To: Pintu Kumar Cc: linux-kernel@vger.kernel.org, Greg Kroah-Hartman , Pintu Kumar References: <1506449281-8790-1-git-send-email-pintu.ping@gmail.com> <1507049339-16963-1-git-send-email-pintu.ping@gmail.com> <414b44ec-6500-c3e5-f8ca-ce1d21a3eb58@redhat.com> From: Laura Abbott Message-ID: <10929681-0816-18d5-1bcb-5616462eecb2@redhat.com> Date: Wed, 4 Oct 2017 15:07:21 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 10/04/2017 04:29 AM, Pintu Kumar wrote: > The whole thing about this test is to share an FD over 2 independent processes. > I think sharing an FD using fork() [parent/child] is not a real use > case scenarios. > Some people may not like the fork example. > Initially when I started with ION, I also needed an FD sharing mechanism between > 2 different process. Thus I came up with this framework using ipcsocket. > Later, if required, we can even replace this with binder_ipc for > android use cases. > Anyways, binder_ipc also internally uses the same concept as this ipcsocket. > To reduce the pain, we can invoke both the tests from a single shell scripts. > I will try to include the same in kselftests, if possible. > > If fork example is really required, we can add another test for it. > This is my opinion. You don't have to treat them as parent/child. Once they've forked the processes are independent so you can use the same socket behavior you've implemented here. I prefer the fork behavior over the shell script because it means I only need to copy one file vs. three if I'm testing in other environments but I'm not that opposed. Thanks, Laura