Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 03 Jan 2014 04:59:16 -0800
From:      "Dave Ng" <chump1@hushmail.com>
To:        "Erich Dollansky" <erichsfreebsdlist@alogt.com>, imp@bsdimp.com
Cc:        freebsd-arm@freebsd.org
Subject:   Re: Beagle recommendations
Message-ID:  <20140103125917.2540CC0288@smtp.hushmail.com>
In-Reply-To: <20140103140658.071f970d@X220.alogt.com>
References:  <20140103052201.E9397200F5@smtp.hushmail.com> <20140103140658.071f970d@X220.alogt.com>

next in thread | previous in thread | raw e-mail | index | archive | help
Thanks Erich and Warner for the help! Sorry for cluttering up -arm,
this was intended for -hackers and I got a little paste-happy without
enough sleep. Moving back to -hackers when I give this another shot.
 Sent using Hushmail
On January 2, 2014 at 10:07 PM, "Erich Dollansky"  wrote:Hi,

On Fri, 03 Jan 2014 00:22:01 -0500
chump1@hushmail.com wrote:

I have to say that my experience is not related to ARM CPUs but
PA-RISC, SPARC and x86 CPUs.
> 
> I have a fairly simple task that involves processing something in a
> 2D array, MxN times. I took a naive approach, 1x process 1x thread,
> and it took a little longer than desired. Well now, I could do
better
> with some multi processing, especially on a multi core box, right?
> 
One process and one thread? You should not gain much as I understand
your writing.
> 
> Well, I have not had much luck. At first I spawned M threads and had
> each iterate over each N in turn, with M between 25-35. It took
much,
> much longer than the single thread. I figured contention and
overhead
> were costing me big, and gave it a shot with a scaled down version
of
> the problem, M=10. Still, much slower than the single thread. A
> little confused, I went back to the big problem set (25-35), and
made
> a new program that spawned only two threads, and each is limited to
> processing only even or only odd data sets. Even that still takes
> twice as long as the single thread version! What is up with that?
> 
Did you try one process per row having one thread per column?

Do the processes and threads have to interact or can each element
processed independent of the other elements?
> 
> More important asides, I am barely doing any real processing at all.
> It is basically a no-op, barely doing more than incrementing the
> counter. Should I expect to see performance gains once I am doing
> real work in the processing portion of my program? Should I expect
to

You will not see the performance drop if you do more processing as the
context switches cost at the moment more time than anything else.

> see much different behavior on a different OS? Also I have one

If you would use a real-time OS, it could be possible but I see it
unlikely as your problem has nothing to do with reaction time.

> physical processor, two cores. Would I see better gains with more
> cores? How do you find processes and threads scale against hardware
> overall?

Your main problem seems to be that you keep the OS busy with context
switches. Use more loops. You could try one process with one thread
per
row and then loop through the columns. Again, if your problem will
allow this.

And never forget, if this is all in a single array, you could use a
single process and then try to find the proper mix between number of
threads and loops. This would take some load of the CPU cache.

Erich
From owner-freebsd-arm@FreeBSD.ORG  Fri Jan  3 15:26:12 2014
Return-Path: <owner-freebsd-arm@FreeBSD.ORG>
Delivered-To: freebsd-arm@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 326FC915
 for <freebsd-arm@freebsd.org>; Fri,  3 Jan 2014 15:26:12 +0000 (UTC)
Received: from mail-we0-x236.google.com (mail-we0-x236.google.com
 [IPv6:2a00:1450:400c:c03::236])
 (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits))
 (No client certificate requested)
 by mx1.freebsd.org (Postfix) with ESMTPS id BC147168A
 for <freebsd-arm@freebsd.org>; Fri,  3 Jan 2014 15:26:11 +0000 (UTC)
Received: by mail-we0-f182.google.com with SMTP id q59so13392184wes.41
 for <freebsd-arm@freebsd.org>; Fri, 03 Jan 2014 07:26:10 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
 h=content-type:mime-version:subject:from:in-reply-to:date:cc
 :content-transfer-encoding:message-id:references:to;
 bh=19z3ygDX38gJBB3FcJ6XV1obV+J19i8DUKynTZHRY0I=;
 b=zqzRWo1bXj57GL5MAlX18k3vTdNUcN3NTmQjJPBfw8HQzUtTD2PhCMKtBDbSyjdfiN
 XKES0+cujz/DbBeQL/p3AD+RHQiC90o02ttzsdHP/TB9FYzii+2NgRaXgX6qlq0H4u4u
 AooFgKWFAbBcbLvS+6mbTsHknc6tdZ7/L8NUpxe+PzMlqioAEoSJy5LE2ZhkmLObaeY6
 cCejLGgkZmbvSnmqkNULzMrdUxljZT7BLRSSUj7cRWFa+whPmYXXRnpkMNMpoRv61VoA
 YVrtfoiddkTURGuaUtTPq2sUbgMezZDbmhHGlZa/OmC9+fYefVMfS6pvEfratAWXs93A
 TmCg==
X-Received: by 10.194.60.103 with SMTP id g7mr60927965wjr.37.1388762770126;
 Fri, 03 Jan 2014 07:26:10 -0800 (PST)
Received: from [192.168.113.40] (43.Red-2-139-192.staticIP.rima-tde.net.
 [2.139.192.43])
 by mx.google.com with ESMTPSA id v7sm3024214wix.5.2014.01.03.07.26.07
 for <multiple recipients>
 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128);
 Fri, 03 Jan 2014 07:26:09 -0800 (PST)
Content-Type: text/plain; charset=us-ascii
Mime-Version: 1.0 (Mac OS X Mail 6.6 \(1510\))
Subject: Re: Beagle recommendations for real
From: fabiodive <fabiodive@gmail.com>
In-Reply-To: <20140103141423.500d0212@X220.alogt.com>
Date: Fri, 3 Jan 2014 15:26:04 +0000
Content-Transfer-Encoding: quoted-printable
Message-Id: <108B8A9D-00F3-4F59-9C17-6C7004C7C0E4@gmail.com>
References: <20140103052327.D526D200F5@smtp.hushmail.com>
 <20140103141423.500d0212@X220.alogt.com>
To: Erich Dollansky <erichsfreebsdlist@alogt.com>
X-Mailer: Apple Mail (2.1510)
Cc: freebsd-arm@freebsd.org
X-BeenThere: freebsd-arm@freebsd.org
X-Mailman-Version: 2.1.17
Precedence: list
List-Id: "Porting FreeBSD to ARM processors." <freebsd-arm.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/options/freebsd-arm>,
 <mailto:freebsd-arm-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/freebsd-arm/>;
List-Post: <mailto:freebsd-arm@freebsd.org>
List-Help: <mailto:freebsd-arm-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/freebsd-arm>,
 <mailto:freebsd-arm-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Fri, 03 Jan 2014 15:26:12 -0000

Hello all,

I really like BBB and for computation works I prefer it over RPI,
also the ethernet stack of BBB is more solid and faster than RPI,
RPI appear to me best suited for video processing,

To produce a shield for BBB consider using a HEXFET MOSFET
with a optocoupler connected to a GPIO.
I can design a schematic and assembly a custom board if you like.

I deploy FreeBSD on BBB using crochet script and some overlay files
I inject in the root during install. For GPIO under FreeBSD try to give =
a=20
look to this:

http://zewaren.net/site/?q=3Dnode/114

you could use a python script to drive the outputs shield.
I can also write some code in C or python to manage the MOSFET shield.

Thank you all
F.


=20
On Jan 3, 2014, at 6:14 AM, Erich Dollansky =
<erichsfreebsdlist@alogt.com> wrote:

> Hi,
>=20
> On Fri, 03 Jan 2014 00:23:27 -0500
> chump1@hushmail.com wrote:
>=20
>>=20
>> I have been toying with my Raspberry Pi for a while now, stuck with
>> Linux thus far. I need to make another pass at FreeBSD on the Pi but
>> between reports of NetBSD bugs and struggles, I cannot help but
>> wonder, perhaps the Beagle products are a little more solid for BSD
>> use. Certainly they have a lot more I/O options than the Pi as well.
>>=20
>>=20
>>=20
>>=20
>> Could someone with some experience please share? Also I am a little
>> confused by the Beagle product line, it looks like the Bone and Bone
>> Black are both superior to the original, yet the original continues
>> to be sold at a higher price. Is that correct or am I missing
>> something?
>>=20
> I just have another question. I would need an extension card with at
> least two relays able to switch 250V AC but a low load of less than
> 100W. Do you of any card which could do the job?
>=20
> Erich
> _______________________________________________
> freebsd-arm@freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-arm
> To unsubscribe, send any mail to "freebsd-arm-unsubscribe@freebsd.org"




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20140103125917.2540CC0288>