Re: WAN connection through a Linux machine

2010-04-20 Thread Etzion Bar-Noy
Oops - and now with reply-all...

Hi.
You should run both these commands (I will not disclose how you make it
apply after-reboot for now)

1. echo 1  /proc/sys/net/ipv4/ip_forward
2. iptables -t nat -A POSTROUTING -o ppp0 -j MASQUERADE

Don't forget to set correct DNS on your host B

Ez

On Tue, Apr 20, 2010 at 8:29 AM, Dan Shimshoni danshi...@gmail.com wrote:

 Hello,
 First, I don't know much about iptables.

 Second, I have a Linux machine (A) with two nics, which is connected
 to the Internet via Bezeq ADSL router.
 This machines runs a pppoe connection to the intenet, so the
 connection is done via ppp0.
 On eth1 I have an inner IP address which I set manually (192.168.0.10).

 I have a second Linux machine (B), nearby. This machine is connected
 directly
 to machine A via ethernet cable. On eth0 I have an inner IP address which
 I set manually (192.168.0.11). So I can ping from 192.168.0.11 to
 192.168.0.10.

 Sometimes I want to connect from machine B to the Internet via machine
 A.
 I suppose this is possible by setting some iptables rule on machine A,
 and
 setting it to work in forwarding mode. Could this done by setting one
 iptables rule
 on machine A?
 What is the proper rule to achieve it?

 DS

 ___
 Linux-il mailing list
 Linux-il@cs.huji.ac.il
 http://mailman.cs.huji.ac.il/mailman/listinfo/linux-il

___
Linux-il mailing list
Linux-il@cs.huji.ac.il
http://mailman.cs.huji.ac.il/mailman/listinfo/linux-il


Re: WAN connection through a Linux machine

2010-04-20 Thread Shachar Shemesh

Etzion Bar-Noy wrote:

Oops - and now with reply-all...

Hi.
You should run both these commands (I will not disclose how you make 
it apply after-reboot for now)


1. echo 1  /proc/sys/net/ipv4/ip_forward
2. iptables -t nat -A POSTROUTING -o ppp0 -j MASQUERADE

Don't forget to set correct DNS on your host B

Ez

Also, RTFM MSS Squashing

Shachar

--
Shachar Shemesh
Lingnu Open Source Consulting Ltd.
http://www.lingnu.com

___
Linux-il mailing list
Linux-il@cs.huji.ac.il
http://mailman.cs.huji.ac.il/mailman/listinfo/linux-il


Reminder: TelFOSS Meeting TOMORROW: Version Control Systems ( 21-Apr-2010 )

2010-04-20 Thread Shlomi Fish
Hi all.

This is a reminder that we're going to meet tomorrow (Wednesday, 21 April) on 
19:00 in Shenkar College in Ramat Gan.

זוהי תזכורת שאנו ניפגש מחר ביום רביעי, 21 באפריל ב-19:00 במכללת שנקר ברמת גן. 
יש הודעה בעברית מתחת להודעה באנגלית.

The [http://tel.foss.org.il/ Tel Aviv Open Source Club] will host 
[http://wiki.osdc.org.il/index.php/Tel_Aviv_Meeting_on_21_April_2010 the talk 
Version Control Systems - What, Why and How] by Yaron Meiry (Sawyer) on 
Wednesday, 21-April-2010, at 19:00 in [http://www.shenkar.ac.il/ Shenkar 
College in Ramat Gan (12 Ann Frank St.)] room 300 ('''note''' the change of 
time and place from the previous meetings - we are now meeting in Shenkar 
college and on 19:00.). There's 
[http://www.shenkar.ac.il/template/default.aspx?maincat=5catid=32 a map with 
directions on the Shenkar college's site]. Further details, maps for arrival, 
etc. can be found 
[http://wiki.osdc.org.il/index.php/Tel_Aviv_Meeting_on_21_April_2010 on the 
Wiki].

Attendance is free, it is not necessary to RSVP and everyone are welcome.

With any other problems, feel free to [http://www.shlomifish.org/me/contact-
me/ contact the organiser].

'''Abstract'''

[http://en.wikipedia.org/wiki/Revision_control Version control systems] allow 
us to keep track of an unlimited amount of changes across any number of files. 
They are an essential tool for any developer.

Using version control systems can help you restore lost data, examine the 
differences between between multiple versions of your data, tag versions and 
access them quickly, simplify cooperation with your peers, easily merge 
changes, and maintain several branches of your data at once.

This presentation will explain what version control systems are, why you 
should use them (even if you think you shouldn't) and how you should use them. 
Most examples will be given using the 
[http://en.wikipedia.org/wiki/Git_%28software%29 open-source version control 
system Git].

'''About the Lecturer'''

Yaron Meiry is a systems' administrator and a Perl developer. He gives talks 
about open source, free software, security and programming standards. Yaron 
has previously given the 
[http://wiki.osdc.org.il/index.php/Tel_Aviv_Meeting_on_28_June_2009 
presentation about red flags in programming of very high languages] in the Tel 
Aviv Club and a presentation about [http://moose.perl.org/ Moose, the modern 
Perl 5 Object System] to TelFOSS and several other clubs.



We are always looking for people who will volunteer to give presentations on 
various topics that are related to open source code and to computers. In case 
you are interested to give a talk, or that you have a suggestion for a talk 
that interests you, we'll be happy to hear from you.

[http://tel.foss.org.il/ מועדון הקוד הפתוח התל-אביבי (תלוקס)] ייפגש שוב כדי 
לשמוע את [http://wiki.osdc.org.il/index.php/Tel_Aviv_Meeting_on_21_April_2010 
ההרצאה מערכות ניהול גרסאות - מה, למה, וכיצד] מאת ירון מאירי (Sawyer) ביום 
רביעי, 21 באפריל 2010 ב-19:00 [http://www.shenkar.ac.il/ במכללת שנקר ברמת גן 
(רח' אנה פרנק 12)] חדר 300 ('''שימו לב''' לשינוי במיקום ובזמן מהפגישות הקודמות 
- אנו ניפגש במכללת שנקר ובשעה 19:00) ניתן למצוא 
[http://www.shenkar.ac.il/template/default.aspx?maincat=5catid=32 מפה עם 
הוראות הגעה באתר של מכללת שנקר]. פרטים נוספים, מפות להגעה, וכו ניתן למצוא 
[http://wiki.osdc.org.il/index.php/Tel_Aviv_Meeting_on_21_April_2010 בוויקי].

הנוכחות בהרצאה היא בחינם ולא נדרשת הרשמה מראש.

במידה שישנן בעיות, אל תהססו [http://www.shlomifish.org/me/contact-me/ ליצור 
קשר עם המארגן].

'''סיכום ההרצאה'''

[http://en.wikipedia.org/wiki/Revision_control מערכות ניהול גרסאות] מאפשרות 
לנו לעקוב אחרי כמות לא מוגבלת של שינויים במספר שרירותי של קבצים. הן מהוות כלי 
הכרחי עבור כל מפתח.

השימוש במערכות ניהול גרסאות יכול לעזור לך לשחזר מידע אבוד, לבחון את ההבדלים 
בין מספר גרסאות של המידע, לתייג גרסאות ולאפשר גישה אליהן בקלות, להקל על שיתוף 
פעולה עם שותפיך לפרוייקטים, לאחות שינויים בקלות, ולתחזק מספר ענפים של המידע 
שלך בו זמנית.

מצגת זאת תסביר מה הן מערכות ניהול גרסאות, מדוע כדאי שתשתמשו בהן (גם אם כרגע 
אינכם חושבים כך) וכיצד כדאי שתעשו בהן שימוש. מרבית הדוגמאות יועברו באמצעות 
[http://en.wikipedia.org/wiki/Git_%28software%29 מערכת ניהול הגרסאות פתוחת-
הקוד גיט.]

'''אודות המרצה'''

ירון מאירי הינו מנהל מערכות ומפתח פרל. הוא מרצה על קוד פתוח, תוכנה חופשית, 
אבטחה וסטנדרטים של תכנות. ירון העביר בעבר את 
[http://wiki.osdc.org.il/index.php/Tel_Aviv_Meeting_on_28_June_2009 ההרצאה על 
דגלים אדומים בתכנות עבור שפות עיליות ביותר] במועדון התל-אביבי ומצגת אודות 
[http://moose.perl.org/ Moose, מערכת העצמים המודרנית לפרל 5] במועדון התל אביבי 
ובמועדונים אחרים נוספים.



אנו תמיד מחפשים מרצים שיתנדבו לתת הרצאות בנושאים שונים הקשורים לקוד-הפתוח 
ולמחשבים. במידה שאתם מעוניינים לתת הרצאה, או שיש לכם הצעה להרצאה שמעניינת 
אתכם, נשמח לשמוע ממכם.



Regards,

Shlomi Fish

-- 
-
Shlomi Fish   http://www.shlomifish.org/
List of 

Re: WAN connection through a Linux machine

2010-04-20 Thread Dan Shimshoni
Hi,
  Well, this did not work at the first trial.
Then, I added 192.168.0.10 as a default gateway on 192.168.0.10 :
route add default gw 192.168.0.10
And it worked
Thanks!
DS


On Tue, Apr 20, 2010 at 9:35 AM, Etzion Bar-Noy
eza...@tournament.org.il wrote:
 Oops - and now with reply-all...
 Hi.
 You should run both these commands (I will not disclose how you make it
 apply after-reboot for now)
 1. echo 1  /proc/sys/net/ipv4/ip_forward
 2. iptables -t nat -A POSTROUTING -o ppp0 -j MASQUERADE
 Don't forget to set correct DNS on your host B
 Ez
 On Tue, Apr 20, 2010 at 8:29 AM, Dan Shimshoni danshi...@gmail.com wrote:

 Hello,
 First, I don't know much about iptables.

 Second, I have a Linux machine (A) with two nics, which is connected
 to the Internet via Bezeq ADSL router.
 This machines runs a pppoe connection to the intenet, so the
 connection is done via ppp0.
 On eth1 I have an inner IP address which I set manually (192.168.0.10).

 I have a second Linux machine (B), nearby. This machine is connected
 directly
 to machine A via ethernet cable. On eth0 I have an inner IP address
 which
 I set manually (192.168.0.11). So I can ping from 192.168.0.11 to
 192.168.0.10.

 Sometimes I want to connect from machine B to the Internet via machine
 A.
 I suppose this is possible by setting some iptables rule on machine A,
 and
 setting it to work in forwarding mode. Could this done by setting one
 iptables rule
 on machine A?
 What is the proper rule to achieve it?

 DS

 ___
 Linux-il mailing list
 Linux-il@cs.huji.ac.il
 http://mailman.cs.huji.ac.il/mailman/listinfo/linux-il



___
Linux-il mailing list
Linux-il@cs.huji.ac.il
http://mailman.cs.huji.ac.il/mailman/listinfo/linux-il


Re: WAN connection through a Linux machine

2010-04-20 Thread Dan Shimshoni
shachar,
I googled for  MSS Squashing. Got 0 results!

What is this MSS Squashing? and how is it related to this issue?

rgs,
DS



On Tue, Apr 20, 2010 at 10:44 AM, Shachar Shemesh shac...@shemesh.biz wrote:
 Etzion Bar-Noy wrote:

 Oops - and now with reply-all...
 Hi.
 You should run both these commands (I will not disclose how you make it
 apply after-reboot for now)
 1. echo 1  /proc/sys/net/ipv4/ip_forward
 2. iptables -t nat -A POSTROUTING -o ppp0 -j MASQUERADE
 Don't forget to set correct DNS on your host B
 Ez

 Also, RTFM MSS Squashing

 Shachar

 --
 Shachar Shemesh
 Lingnu Open Source Consulting Ltd.
 http://www.lingnu.com


___
Linux-il mailing list
Linux-il@cs.huji.ac.il
http://mailman.cs.huji.ac.il/mailman/listinfo/linux-il


Re: WAN connection through a Linux machine

2010-04-20 Thread Shachar Shemesh

Dan Shimshoni wrote:

shachar,
I googled for  MSS Squashing. Got 0 results!

What is this MSS Squashing? and how is it related to this issue?

rgs,
DS


  

The term used in the iptables man page is clamp-mss-to-pmtu

The ethernet maximal transfer unit (MTU) is 1500 bytes (more or less, 
but in practice, this is the default). Since pppoe has some overhead, 
the effective MTU on ppp0 is lower (about 1470 bytes). Packets sent out 
by your machine B broadcast the desired packet length on the return path 
through a TCP option called MSS (maximal segment size).


Theoretically, TCP will figure out on its own that the path MTU (PMTU) 
is lower than the end MTU as advertised by the MSS. This has two 
disadvantages:
1. It has worse performance than advertising the correct number in the 
MSS to begin with
2. Some firewalls block the ICMP message used to report this case (code 
3 type 4 - fragmentation needed but don't fragment set). As a result, 
you get black hole syndrom.


The solution is to have iptables alter the MSS field of the TCP option 
to the value it knows is correct.


Shachar

--
Shachar Shemesh
Lingnu Open Source Consulting Ltd.
http://www.lingnu.com

___
Linux-il mailing list
Linux-il@cs.huji.ac.il
http://mailman.cs.huji.ac.il/mailman/listinfo/linux-il


Re: Reminder: TelFOSS Meeting TOMORROW: Version Control Systems ( 21-Apr-2010 )

2010-04-20 Thread Constantine Shulyupin
Looks interesting! I would like to learn GIT more.

2010/4/20 Shlomi Fish shlo...@iglu.org.il:
 Hi all.

 This is a reminder that we're going to meet tomorrow (Wednesday, 21 April) on
 19:00 in Shenkar College in Ramat Gan.

 זוהי תזכורת שאנו ניפגש מחר ביום רביעי, 21 באפריל ב-19:00 במכללת שנקר ברמת גן.
 יש הודעה בעברית מתחת להודעה באנגלית.

 The [http://tel.foss.org.il/ Tel Aviv Open Source Club] will host
 [http://wiki.osdc.org.il/index.php/Tel_Aviv_Meeting_on_21_April_2010 the talk
 Version Control Systems - What, Why and How] by Yaron Meiry (Sawyer) on
 Wednesday, 21-April-2010, at 19:00 in [http://www.shenkar.ac.il/ Shenkar
 College in Ramat Gan (12 Ann Frank St.)] room 300 ('''note''' the change of
 time and place from the previous meetings - we are now meeting in Shenkar
 college and on 19:00.). There's
 [http://www.shenkar.ac.il/template/default.aspx?maincat=5catid=32 a map with
 directions on the Shenkar college's site]. Further details, maps for arrival,
 etc. can be found
 [http://wiki.osdc.org.il/index.php/Tel_Aviv_Meeting_on_21_April_2010 on the
 Wiki].

 Attendance is free, it is not necessary to RSVP and everyone are welcome.

 With any other problems, feel free to [http://www.shlomifish.org/me/contact-
 me/ contact the organiser].

 '''Abstract'''

 [http://en.wikipedia.org/wiki/Revision_control Version control systems] allow
 us to keep track of an unlimited amount of changes across any number of files.
 They are an essential tool for any developer.

 Using version control systems can help you restore lost data, examine the
 differences between between multiple versions of your data, tag versions and
 access them quickly, simplify cooperation with your peers, easily merge
 changes, and maintain several branches of your data at once.

 This presentation will explain what version control systems are, why you
 should use them (even if you think you shouldn't) and how you should use them.
 Most examples will be given using the
 [http://en.wikipedia.org/wiki/Git_%28software%29 open-source version control
 system Git].

 '''About the Lecturer'''

 Yaron Meiry is a systems' administrator and a Perl developer. He gives talks
 about open source, free software, security and programming standards. Yaron
 has previously given the
 [http://wiki.osdc.org.il/index.php/Tel_Aviv_Meeting_on_28_June_2009
 presentation about red flags in programming of very high languages] in the Tel
 Aviv Club and a presentation about [http://moose.perl.org/ Moose, the modern
 Perl 5 Object System] to TelFOSS and several other clubs.

 

 We are always looking for people who will volunteer to give presentations on
 various topics that are related to open source code and to computers. In case
 you are interested to give a talk, or that you have a suggestion for a talk
 that interests you, we'll be happy to hear from you.

 [http://tel.foss.org.il/ מועדון הקוד הפתוח התל-אביבי (תלוקס)] ייפגש שוב כדי
 לשמוע את [http://wiki.osdc.org.il/index.php/Tel_Aviv_Meeting_on_21_April_2010
 ההרצאה מערכות ניהול גרסאות - מה, למה, וכיצד] מאת ירון מאירי (Sawyer) ביום
 רביעי, 21 באפריל 2010 ב-19:00 [http://www.shenkar.ac.il/ במכללת שנקר ברמת גן
 (רח' אנה פרנק 12)] חדר 300 ('''שימו לב''' לשינוי במיקום ובזמן מהפגישות הקודמות
 - אנו ניפגש במכללת שנקר ובשעה 19:00) ניתן למצוא
 [http://www.shenkar.ac.il/template/default.aspx?maincat=5catid=32 מפה עם
 הוראות הגעה באתר של מכללת שנקר]. פרטים נוספים, מפות להגעה, וכו ניתן למצוא
 [http://wiki.osdc.org.il/index.php/Tel_Aviv_Meeting_on_21_April_2010 בוויקי].

 הנוכחות בהרצאה היא בחינם ולא נדרשת הרשמה מראש.

 במידה שישנן בעיות, אל תהססו [http://www.shlomifish.org/me/contact-me/ ליצור
 קשר עם המארגן].

 '''סיכום ההרצאה'''

 [http://en.wikipedia.org/wiki/Revision_control מערכות ניהול גרסאות] מאפשרות
 לנו לעקוב אחרי כמות לא מוגבלת של שינויים במספר שרירותי של קבצים. הן מהוות כלי
 הכרחי עבור כל מפתח.

 השימוש במערכות ניהול גרסאות יכול לעזור לך לשחזר מידע אבוד, לבחון את ההבדלים
 בין מספר גרסאות של המידע, לתייג גרסאות ולאפשר גישה אליהן בקלות, להקל על שיתוף
 פעולה עם שותפיך לפרוייקטים, לאחות שינויים בקלות, ולתחזק מספר ענפים של המידע
 שלך בו זמנית.

 מצגת זאת תסביר מה הן מערכות ניהול גרסאות, מדוע כדאי שתשתמשו בהן (גם אם כרגע
 אינכם חושבים כך) וכיצד כדאי שתעשו בהן שימוש. מרבית הדוגמאות יועברו באמצעות
 [http://en.wikipedia.org/wiki/Git_%28software%29 מערכת ניהול הגרסאות פתוחת-
 הקוד גיט.]

 '''אודות המרצה'''

 ירון מאירי הינו מנהל מערכות ומפתח פרל. הוא מרצה על קוד פתוח, תוכנה חופשית,
 אבטחה וסטנדרטים של תכנות. ירון העביר בעבר את
 [http://wiki.osdc.org.il/index.php/Tel_Aviv_Meeting_on_28_June_2009 ההרצאה על
 דגלים אדומים בתכנות עבור שפות עיליות ביותר] במועדון התל-אביבי ומצגת אודות
 [http://moose.perl.org/ Moose, מערכת העצמים המודרנית לפרל 5] במועדון התל אביבי
 ובמועדונים אחרים נוספים.

 

 אנו תמיד מחפשים מרצים שיתנדבו לתת הרצאות בנושאים שונים הקשורים לקוד-הפתוח
 ולמחשבים. במידה שאתם מעוניינים לתת הרצאה, או שיש לכם הצעה להרצאה שמעניינת
 אתכם, נשמח לשמוע ממכם.

 

 Regards,

        Shlomi Fish

 --

Re: WAN connection through a Linux machine

2010-04-20 Thread Dan Shimshoni
ok, now this is more clear.

But is this problem specific to this scenario?
I mean, when I use a single machine to connect directly to the
internet via bezeq ADSL , without running any iptables rules at all,
using PPPOE ,  I should have the same problem, don't I ?
Is there a solution in this case ? (remember, I cannot use this
iptables clamp-mss-to-pmtuoption as in this scenario in fact I do
not use iptables at all).

Second, ifconfig ppp0 shows that the mtu is 1492.

DS

On Tue, Apr 20, 2010 at 1:56 PM, Shachar Shemesh shac...@shemesh.biz wrote:
 Dan Shimshoni wrote:

 shachar,
 I googled for  MSS Squashing. Got 0 results!

 What is this MSS Squashing? and how is it related to this issue?

 rgs,
 DS




 The term used in the iptables man page is clamp-mss-to-pmtu

 The ethernet maximal transfer unit (MTU) is 1500 bytes (more or less, but in
 practice, this is the default). Since pppoe has some overhead, the effective
 MTU on ppp0 is lower (about 1470 bytes). Packets sent out by your machine B
 broadcast the desired packet length on the return path through a TCP option
 called MSS (maximal segment size).

 Theoretically, TCP will figure out on its own that the path MTU (PMTU) is
 lower than the end MTU as advertised by the MSS. This has two disadvantages:
 1. It has worse performance than advertising the correct number in the MSS
 to begin with
 2. Some firewalls block the ICMP message used to report this case (code 3
 type 4 - fragmentation needed but don't fragment set). As a result, you
 get black hole syndrom.

 The solution is to have iptables alter the MSS field of the TCP option to
 the value it knows is correct.

 Shachar

 --
 Shachar Shemesh
 Lingnu Open Source Consulting Ltd.
 http://www.lingnu.com


___
Linux-il mailing list
Linux-il@cs.huji.ac.il
http://mailman.cs.huji.ac.il/mailman/listinfo/linux-il


Re: WAN connection through a Linux machine

2010-04-20 Thread Shachar Shemesh

Dan Shimshoni wrote:

ok, now this is more clear.

But is this problem specific to this scenario?
I mean, when I use a single machine to connect directly to the
internet via bezeq ADSL , without running any iptables rules at all,
using PPPOE ,  I should have the same problem, don't I ?
  
No. The packets go out through the ppp0 interface, which already has a 
lower MTU (1492 by your report). As such, they already carry the right MSS.


Shachar

--
Shachar Shemesh
Lingnu Open Source Consulting Ltd.
http://www.lingnu.com

___
Linux-il mailing list
Linux-il@cs.huji.ac.il
http://mailman.cs.huji.ac.il/mailman/listinfo/linux-il


Sony ebook reader

2010-04-20 Thread Cyril Scetbon

Hi,

I tried to read a pdf with hebrew text inside with the PRS-600 ebook 
reader from Sony. However, it works with small font size but the text 
order is changed when I raise the font size :(


anyone met the same issue and found a fix ?

--
Cyril SCETBON


___
Linux-il mailing list
Linux-il@cs.huji.ac.il
http://mailman.cs.huji.ac.il/mailman/listinfo/linux-il


About Multi-cores and Multi-tasking

2010-04-20 Thread Shlomi Fish
Hi all!

I once read that in order to truly take advantage of having multiple cores on 
the same CPU, then one needs to use several threads. On the other hand some 
people assume or implied that if your application splits the work among 
several processes, then it can also take advantage of multiple cores. So my 
question is: can several distinct processes each execute in their own cores?

From my experience with benchmarking http://fc-solve.berlios.de/ , I've 
noticed that multi-processing was a bit faster than multi-threading on my 
P4-2.4GHz machine (hyperthreading) while multi-threading was faster than 
multi-processing on my Intel x86-64-based laptop with two cores running in 
x86-64 mode. It's possible that the multi-tasking in both cases is sub-
optimal, but I've ran the same programs on both computers.

I'd appreciate if anyone can shed any light on it.

Regards,

Shlomi Fish
-- 
-
Shlomi Fish   http://www.shlomifish.org/
http://www.shlomifish.org/humour/ways_to_do_it.html

Deletionists delete Wikipedia articles that they consider lame.
Chuck Norris deletes deletionists whom he considers lame.

Please reply to list if it's a mailing list post - http://shlom.in/reply .

___
Linux-il mailing list
Linux-il@cs.huji.ac.il
http://mailman.cs.huji.ac.il/mailman/listinfo/linux-il


Re: About Multi-cores and Multi-tasking

2010-04-20 Thread shimi
On Tue, Apr 20, 2010 at 11:25 PM, Shlomi Fish shlo...@iglu.org.il wrote:

 Hi all!

 I once read that in order to truly take advantage of having multiple cores
 on
 the same CPU, then one needs to use several threads. On the other hand some
 people assume or implied that if your application splits the work among
 several processes, then it can also take advantage of multiple cores. So my
 question is: can several distinct processes each execute in their own
 cores?

 From my experience with benchmarking http://fc-solve.berlios.de/ , I've
 noticed that multi-processing was a bit faster than multi-threading on my
 P4-2.4GHz machine (hyperthreading) while multi-threading was faster than
 multi-processing on my Intel x86-64-based laptop with two cores running in
 x86-64 mode. It's possible that the multi-tasking in both cases is sub-
 optimal, but I've ran the same programs on both computers.


Intel's hyper-threading makes your system THINK you have two cores; It's
actually one core, capable of doing the same amount of work. If your program
is multi-process/thread it will perhaps have a slight advantage due to this
because of how schedulers work (and what's done at idle cpu time), but on
a single process, I believe it only makes it worse. I turn it off on Intel
machines I manage...

All in all, when HT does manage to add something to performance, benchmarks
have shown that it's pretty much negligible. On the past few years, Intel
dumped this technology due to that fact (I guess). Lately they've returned
it (to i* CPUs), and I have no idea why.

If you want something that runs fast on multi-threads/processes, get a
machine with true multi processors ! :) (and yes, multi-core on one chip
certainly counts and sometimes even better in terms of performance than
multi-CPU - especially if the CPU supports a shared cache between the cores
and your processes does not have affinity to a specific core...). Of course
that when you want to build a million-CPU box, sometimes you HAVE to
multi-CPU ;) AMD recently announced a 12 core chip that is basically what
Intel did in Pentium D - two 6 core glued together. Throw 4 of these on a
4 socket motherboard, and you have a 48-CPU supercomputer in one box. Nice,
isn't it? :)

-- Shimi
___
Linux-il mailing list
Linux-il@cs.huji.ac.il
http://mailman.cs.huji.ac.il/mailman/listinfo/linux-il


home automation question

2010-04-20 Thread Erez D
hi guys.

i have a warehouse. it has two connections to the buildings - power and
ethernet.

i want to control the warehouse external lights from the house.

I thought of buying an X10 light switch, but it seems that each consts
around 50$, which is expensive
so my other option is a computer i can control (prefferably a linux box,
somthing like nslu2).

so:
1. anybody knows of a cheap place to buy X10 stuff (or somthing similiar) ?
2. what is the cheepest computer (doesn't have to be a full computer, an
avr with ethernet and gpio will do) ?

thanks.
erez.
___
Linux-il mailing list
Linux-il@cs.huji.ac.il
http://mailman.cs.huji.ac.il/mailman/listinfo/linux-il


Re: About Multi-cores and Multi-tasking

2010-04-20 Thread Shachar Shemesh

Shlomi Fish wrote:

Hi all!

I once read that in order to truly take advantage of having multiple cores on 
the same CPU, then one needs to use several threads. On the other hand some 
people assume or implied that if your application splits the work among 
several processes, then it can also take advantage of multiple cores. So my 
question is: can several distinct processes each execute in their own cores?


From my experience with benchmarking http://fc-solve.berlios.de/ , I've 
noticed that multi-processing was a bit faster than multi-threading on my 
P4-2.4GHz machine (hyperthreading) while multi-threading was faster than 
multi-processing on my Intel x86-64-based laptop with two cores running in 
x86-64 mode. It's possible that the multi-tasking in both cases is sub-

optimal, but I've ran the same programs on both computers.

I'd appreciate if anyone can shed any light on it.

Regards,

Shlomi Fish
  

Let's define a few terms.

Multi-processor - several CPUs on the same machine. These are two 
distinct CPUs.
Multi-core - several CPUs inside the same chip. The CPUs are distinct, 
but they do share some caching data.
Hyperthreading - Now there's a misunderstood concept. Ever since the 
first Pentium, even a single core has the ability for some parallel 
processing. The original Pentium had two pipelines, in which it could 
(sometimes) execute two consecutive machine instructions at the same time.


With hyperthreading, the parallelilsm extend beyond executive 
instructions. Essentially, you have one CPU with two sets of registers 
and, say, six pipelines. Two are dedicated to the first set of 
registers, two to the second, and two can be assigned to either one, as 
the need arises.


The rest of this mail is pure conjecture.

The more shared the data is between the execution threads, the closer 
you want them to run. This way, cache does not need to be invalidated 
whenever a piece of data changes. This is why, when you run two 
processes, multi-CPU is faster (each process has its own data and 
instruction cache, which results in larger cache), but when it is a 
multi threaded app, multi core is faster (shared L2 cache). When you run 
the threads mode on multi-cpu, each change done to the shared address 
space needs to invalidate the cache the other CPU has for that same 
area, which is why you suffer the slowdowns.


As for hyperthreading - in theory, that should have been fastest, as 
they share L1 cache as well as L2. There are several implementation 
problems with this, however. The most obvious one is that it is 
difficult to know when one CPU is truly idle. Think about a thread 
spinning on a spin lock while waiting for the other one to complete a 
task. It does not appear idle, so it gets both assignable pipelines, 
while the other semi-core has only two pipes to complete the task that 
is blocking the lock to begin with. Another problem with hyperthreading 
is that it is stretching the L1 cache thin when executing unrelated 
tasks. My guess is that this is why Intel wound out removing it.


If, as Shimi is saying, they are re-introducing them, maybe they think 
that they found reasonable solutions to the above problems.


Shachar

--
Shachar Shemesh
Lingnu Open Source Consulting Ltd.
http://www.lingnu.com

___
Linux-il mailing list
Linux-il@cs.huji.ac.il
http://mailman.cs.huji.ac.il/mailman/listinfo/linux-il


Re: home automation question

2010-04-20 Thread Marc Volovic
AVR is fine. So is a second hand wrap or alix.
More expensive than X10 :-) mind you.
However, X-10 is a very unreliable protocol, you're better off toggling a GPIO 
line which, in turn, toggles on ptocoupler...
eBay _is_ your friend.
m

On Apr 21, 2010, at 8:19 AM, Erez D wrote:

 hi guys.
 
 i have a warehouse. it has two connections to the buildings - power and 
 ethernet.
 
 i want to control the warehouse external lights from the house.
 
 I thought of buying an X10 light switch, but it seems that each consts around 
 50$, which is expensive
 so my other option is a computer i can control (prefferably a linux box, 
 somthing like nslu2).
 
 so:
 1. anybody knows of a cheap place to buy X10 stuff (or somthing similiar) ?
 2. what is the cheepest computer (doesn't have to be a full computer, an 
 avr with ethernet and gpio will do) ?
 
 thanks.
 erez.
 ___
 Linux-il mailing list
 Linux-il@cs.huji.ac.il
 http://mailman.cs.huji.ac.il/mailman/listinfo/linux-il

Marc Volovic
marcvolo...@me.com




___
Linux-il mailing list
Linux-il@cs.huji.ac.il
http://mailman.cs.huji.ac.il/mailman/listinfo/linux-il