Wednesday, May 30, 2007

19 Weeks

Today, my wife had an irregular medical checkup for thatsdone 3.0.

His (or her?) sister, thatsdone 2.0, past away around her 18th weeks, and from last night thatsdone 3.0 was very silent (didn't move.) Thus, we really wanted to know if the baby is OK or not.

My wife witnessed thatsdone 3.0 was waving hands and legs again. :)

A Small Project on SourceForge

I opened a small new project on SourceForge.

http://kusanagi.sourceforge.net/

It's a collection of tools and documents for trouble shooting, and I named it
after a Japanese legendary sword.

Recently for a couple of days, sourceforge.net shell server seemed to be down. :(
But anyway, I set up the above web page and uploaded several my stupid programs.
From now, that will be the placeholder of my small works. :)

Sunday, May 27, 2007

Electric Bill

Recently, my wife blamed me for the elelctric bill. :(
According to her, we got about 1000 yen higher electric bill compared to the same month last year.

Actually, last month I kept my PentiumD 930 box powered on during the week end days.
We can guess that consumes roughly 130W/hour, and that means I consumed 130W/h x 24h x 2 days x 4 weeks = 25Kwh more electric power. But, when my wife blamed me, I made a mistake in the above calculation. I estimated that lower than actual by 1 digit, 2.5-5kwh. :(

Yes, mom. You're right.... :o

Patisserie Francaise Region

Yesterday, we went to Shinjuku Takashimaya.



Recently, Shinjuku Takashimaya opened a new cake shop where many patisseries get together, and of course my wife does not miss that. :)
We bought above two cakes. :)

Both of them are works of Patisserie Masao Fujimaki (http://www.e-region.co.jp/).He seems to be not only a patisserie but also a baker, and perhaps that's why his cakes are bigger than ones of other patisseries. My choice was the left one, and I like it very much. :)

BTW, the right one above looks like something. :o

Stick Sweets Factory

Today, we went to Wakaba Keyaki-Mall after visiting Azusamiten Shrine and prayed for thatsdone 3.0.

There is a small sweets shop, "Stick Sweets Factory".

Our choice were Caramel Pudding, and a cup of Turkish tea, Chay.



The chay was too sweet and its flavor was something strange against my expectation.
1.0 stars. :(

Azusamiten Shrine

It's a fine day today.

I wet to the Azusa-miten Shrine (阿豆佐味天神社, あずさみてんじんじゃ) in Tachikawa city with my wife. There are some more small shrines for example Suitengu (水天宮, すいてんぐう) which gives the blessing for safe deliveries. Yes, we went there to pray for safe delivery of our child. :)



BTW, they seem to have another name, The Shrine for Getting Back Cats. :o
As you can see in the picture below right, in Japanese it's called as "猫返し神社." :o



Hey Harada-san, are you reading?
If you got troubles about your cats, you can visit the shrine. :)

Saturday, May 26, 2007

A Signboard

I saw a funny signboard today.



When I found it, the shop was closed and I was not sure what kind of shop it is. Anyway, I and my wife thought that would be a coffee shop or a bar. :o

The above signboard says something like "The busy shop." In Japanese, it's "暇を欠く店 (Hima wo Kaku Mise)", and it's literal translation is "The shop which is lacking spare time." Anyway I don't understand why they placed a signboard like that.

BTW, I found a blog entry referring the same signboard. This guy found the signboard earlier than me about a month, and he seemed to have the same impression with me. :)

Wednesday, May 23, 2007

18 Weeks

Now thatsdone 3.0 is 18 weeks! :)
Today, our doctor tried to find out whether the baby is a boy or a girl, but still undetermined.
Anyway, today our baby was not sleeping and waving hands and legs.
I'm looking forward to October 23. :)

Sunday, May 20, 2007

Spams for Sale?

Another funny thing (for me) I saw at Mitsukoshi today. :)


  • SPAM Standard
  • SPAM with 60% Less Sodium
  • SPAM Lite
  • SPAM Hot and Spicy
In also Japan, they are very popular.

BTW, according to Homel Foods, their brand name is SPAM, and I'm talking about this spam. :)

3rd World Wine?

Well, today I saw two funny things at Mitsukosshi Musashi Murayama in Diamond City Mu.

I took the picture above at the 1st floor of Mitsukoshi, and the board says, "Third World Wine."
But, there were wine bottles from Japan(!), USA(!), Australia, Israel, Chile...
I can understand France, Italy... are the developed countries, but I'm wondering which countries belong to the Second World w.r.t. Wines.
Georgia? (?_?)

Musashino Sabo

Today, I went to Diamond City Mu with my wife again.
She really loves shopping. :o

We had a lunch at Musashino Sabo on the first floor there,
and my choice was Carbonara with Kyoto style bean paste(Miso) cream.



At first, I was not sure if bean paste matches with pasta, but flavor of
bean paste was not so strong and I like it. :)

Saturday, May 19, 2007

3 People Please!?

I was astonished by my wife today.

We wanted to have a dinner at an Italian restaurant near our house, Pasta and Pizza Primo Piatto, and went there around 18:30.

My wife said to a floor lady in the entrance there, "Three people, please."

Yes, our child is indeed due in the end of this October about five months future, but at this moment we need only two seats. :o

Well, what are you thinking about, honey? :o)

Haguregumo



Haguregumo (浮浪雲) is a bit new Chinese noodle (Ramem) restaurant around our room, Koganei city, Tokyo.
Their noodle is a bit thick, and we have 3 x 4 = 12 choices for the recipe.
  • Soup ---- strong, normal, thin
  • Noodle -- hard,normal,soft
  • Oil------- much,normal, less, none
I chose normal soup, hard noodle, normal oil, and normal soup turned out to be the correct choice for me. I like it. :)

BTW, I don't know what is "House Ramen" (家系ラーメン), but according to literature on Internet, there seems to be very deep world. I should consult with a professional Ramen guy.
Hi, Harada-san, are you reading?
Give me a lecture, please. :)

Friday, May 18, 2007

Google Analytics

Recently, I got a Google Analytics account.
Especially, I like the following geological report. :)



Note that my mouse pointer was on Australia when I captured the above screenshot.

Thursday, May 17, 2007

A Bug Report

Today, I got a bug report of this device driver.

'rye' had two bugs. :(
  1. CPU usage rate was different from its specification. :(
  2. There was a bug in saving the current sampling data of CPU usage data. So, calculated CPU usage rate decreased at ever sampling time even under a stable work load in case of an SMP machine. :(
Now, rye is version 3.0 at this URL.

Thanks, Furuta-kun! :)

Tuesday, May 15, 2007

Oyster Bar Again

Again, I had a lunch at the Grand Central Oyster Bar & Restaurant, Tokyo today. :)



My choice was Risotto with Oyster.

Actually, last time I went to the restaurant it was to be a small welcome party for one of my colleagues. But, unfortunately the guy was not good recently and we went to the restaurant without him cause we cannot wait for his recovery. :o

Today, finally we could welcome him.

Thanks Ushida-san, again! :)

Monday, May 14, 2007

Wikipedian

I got an account of Wikipedia.
I just wanted to correct a typo of an article about object-oriented programming, but something pushed me.
Here is my userpage at Wikipedia, and I seem to be a new Wikipedian from Today. :)

Sunday, May 13, 2007

Linux Context Switch



Since I wrote this entry, I was wondering about the top address of a stack
trace of a process sleeping in schedule() like below:
crash> bt
PID: 2086 TASK: ffff81007f108080 CPU: 1 COMMAND: "sendmail"
#0 [ffff810078291950] schedule at ffffffff80260ab2 <== Here!
#1 [ffff810078291a30] schedule_timeout at ffffffff80261416
#2 [ffff810078291a80] do_select at ffffffff80211369
[snip]

crash> rd ffff810078291950 2
ffff810078291950: ffff810078291a28 0000000000000031 (.)x....1.......

My point is that '0xffffffff80260ab2' is not equal to the value stored
at '0xffff810078291950' in the above case. This is different from other
stack frames. Actually, in the above example values stored at the stack
frame #1 and #2 are exactly the return addresses at the rightmost column
of each line.

Q1.

First of all, what does the address '0xffffffff80260ab2' mean?
Assuming the address is a return address of a FAR call instruction,
I disassembled 0xffffffff80260ab2 - five bytes, and got the following:


crash> dis ffffffff80260aad 16
0xffffffff80260aad : callq 0xffffffff80262898 <__kprobes_text_start>
0xffffffff80260ab2 : mov %gs:0x0,%rsi
[snip]

As shown in the above, its procedure name is 'thread_return' presumably
in schedule(). Here, schedule() is the central function to make decisions
which process to run.

Q2.

Next question is why 'thread_return?'

I looked into crash-4.0-2.13 source tree and understood the reason.
Here is a call graph of 'bt' command.

bt_cmd (./kernel.c:1351 or ./kernel.c:1359)                    
back_trace ()
mach_dep->get_stack_frame (./kernel.c:1518)
x86_64_get_stack_frame (x86_64.c:2296)
x86_64_get_pc (x86_64.c:2510)
# Here, if thread_struct does not have %rip as its member,
# x86_64_get_pc returns 'thread_return' as %rip.
# That's the case of kernel 2.6.11 or later.

In short, 'bt' command of crash always returns the same address for a process
which is NOT on a physical CPU.
The stack frame #0 above is the place where the process left in-execution
state and switched to the next process to get the CPU.
In short, a context switch occurs. So, the return address must be
the instruction pointer (%rip) when the previous/released CPU
process gets CPU and resume execution again.
As it's natural that there are several things to do for kernel after switching
one process to another, thus the return address of can be different from
usual function call cases.

Q3.

My third question is why there is no 'thread_return' address on the top of
stack frame #0?

We can understand the reason loooking into schedule().
Here is another call graph of schedule().
schedule()
context_switch() # an inline architecutre independent C function
switch_to() # a macro in assembly language
callq __switch_to # an architecture dependent C function
Actually, 'switch_to' is defined like the following in case of x86_64
(include/asm-x86_64/system.h), and as is shown below the stack pointer
%rsp is switched to the next process's one before calling '__switch_to.'
 23 #define switch_to(prev,next,last)                                      \
24 asm volatile(SAVE_CONTEXT \
25 "movq %%rsp,%P[threadrsp](%[prev])\n\t" /* save RSP */ \
26 "movq %P[threadrsp](%[next]),%%rsp\n\t" /* restore RSP */ \
27 "call __switch_to\n\t" \
28 ".globl thread_return\n" \
29 "thread_return:\n\t" \
30 "movq %%gs:%P[pda_pcurrent],%%rsi\n\t" \
31 "movq %P[thread_info](%%rsi),%%r8\n\t" \
32 LOCK_PREFIX "btr %[tif_fork],%P[ti_flags](%%r8)\n\t" \
33 "movq %%rax,%%rdi\n\t" \
34 "jc ret_from_fork\n\t" \
35 RESTORE_CONTEXT \
[snip]

The call instruction on line 27 above does not save its return address
('thread_return') into the previous stack frame top, because the kernel
changed the current stack frame from the previous one (saved RSP on line 25)
to the next (restored RSP on line 26) just before that.

Thus, thread_return does not appear in the stack frame of the previos process.

Q4.

The last question is what is 'thread_return'?
But, the name looks like self-explaining, and actually on the line 28
of 'switch_to' definition above there it is. It's just the re-entry
point for a process on returning from '__switch_to().'

I hope this article is useful for people.

Saturday, May 12, 2007

Objet

Yesterday, I went to this place near the JR Shin-Narashino Station to attend at a kind of business camp.

On my way to the place from the station, I encountered a strange object.
What is this at all? :o

Thursday, May 10, 2007

Oyster Bar de Lunch

I had a gorgeous lunch today at this restaurant.
It's almost two years since the last time I went there.

I really love the new england cram chowder below.



The main dish was an oyster bowl below left.



Thanks, Ushida-san! :)

BTW, I know "Lunch de Oyster Bar" is correct, but it's actually a Japanese phrase meaning "Lunch at Oyster Bar." :o

Monday, May 07, 2007

Improving Back Trace

After writing this entry, I was thinking how we can improve 'bt' command of the crash utility.

I wrote an LDAS (Linux Dump Analysis Script) of Alicia, btx.ldas, as an alternative of 'bt'. (btx.ldas is available at this URL as usual.)

Roughly speaking, btx.ldas is a filter of 'bt' command results.
The basic idea is that there are return addresses on the right most colums and that means there should be call instructions just before the address. Furthermore, it's possible to check whether a supposed return address is really correct can by seeing if the operand of a call instruction is the address of the next stack frame or not.
That's what btx.ldas does basically.
Of couse, there are several technical issues, but as shown in the following, this approach looks to work. :)

The below examples are results by 'btx.ldas' and crash 'bt' command of the same "sendmail" process taken on my PentiumD 930 / FedoraCore 6 (x86_64) box.

(1) crash 'bt' command example

Among the 22 stack frames shown below, there are only 6 correct ones as I wrote in this entry.
btx.ldas checks five bytes (size of a call instruction) before the rightmost addresses colored in blue in each stack frame.

alicia> bt 2086
PID: 2086 TASK: ffff81007f108080 CPU: 0 COMMAND: "sendmail"
#0 [ffff810078291950] schedule at ffffffff80260ab2
#1 [ffff810078291a30] schedule_timeout at ffffffff80261416
#2 [ffff810078291a80] do_select at ffffffff80211369
#3 [ffff810078291b70] proc_alloc_inode at ffffffff802f48dc
#4 [ffff810078291b80] alloc_inode at ffffffff80225746
#5 [ffff810078291bb0] inotify_d_instantiate at ffffffff802e6a70
#6 [ffff810078291bd0] d_rehash at ffffffff80240566
#7 [ffff810078291bf0] proc_lookup at ffffffff802277cd
#8 [ffff810078291c20] proc_root_lookup at ffffffff80254ddd
#9 [ffff810078291c40] do_lookup at ffffffff8020cade
#10 [ffff810078291c70] dput at ffffffff8020cff4
#11 [ffff810078291c90] __link_path_walk at ffffffff8020a196
#12 [ffff810078291cf0] vsnprintf at ffffffff80219e0f
#13 [ffff810078291d00] link_path_walk at ffffffff8020e776

#14 [ffff810078291d90] core_sys_select at ffffffff802d8dd8
#15 [ffff810078291e00] __next_cpu at ffffffff8033bf39
#16 [ffff810078291e10] nr_running at ffffffff802861c5
#17 [ffff810078291e30] loadavg_read_proc at ffffffff802f7be7
#18 [ffff810078291e60] lock_kernel at ffffffff802627fb
#19 [ffff810078291e80] de_put at ffffffff802f480b

#20 [ffff810078291f20] sys_select at ffffffff80216185
#21 [ffff810078291f80] system_call at ffffffff8025c00e
RIP: 00002aaaac4cdb93 RSP: 00007fff27a8fcb8 RFLAGS: 00010206
RAX: 0000000000000017 RBX: ffffffff8025c00e RCX: 000000009999999a
RDX: 0000000000000000 RSI: 00007fff27a90580 RDI: 0000000000000005
RBP: 00007fff27a90580 R8: 00007fff27a90600 R9: 00007fff27a8eadf
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000004
R13: 0000000000000001 R14: 0000000000000001 R15: 0000555555816330
ORIG_RAX: 0000000000000017 CS: 0033 SS: 002b

(2) btx.ldas result

Below is an example using btx.ldas and Alicia-1.1.5.
Extra 16 frames above were suppressed.

alicia> load 'btx.ldas';
alicia> btx 2086;
PID: 2086 TASK: ffff81007f108080 CPU: 0 COMMAND: "sendmail"
#0 [ffff810078291950] schedule at ffffffff80260ab2
#1 [ffff810078291a30] schedule_timeout at ffffffff80261416
#2 [ffff810078291a80] do_select at ffffffff80211369
#3 [ffff810078291d90] core_sys_select at ffffffff802d8dd8
#4 [ffff810078291f20] sys_select at ffffffff80216185
#5 [ffff810078291f80] system_call at ffffffff8025c00e
RIP: 00002aaaac4cdb93 RSP: 00007fff27a8fcb8 RFLAGS: 00010202
RAX: 0000000000000017 RBX: ffffffff8025c00e RCX: 000000001eb851ec
RDX: 0000000000000000 RSI: 00007fff27a90580 RDI: 0000000000000005
RBP: 00007fff27a90580 R8: 00007fff27a90600 R9: 00007fff27a8eadf
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000004
R13: 0000000000000001 R14: 0000000000000001 R15: 0000555555816330
ORIG_RAX: 0000000000000017 CS: 0033 SS: 002b

Global Optimization

Recently I read an interesting article about a difference of business
structures between western countries and Japan. The article was an interview
of a CRM software company selling president.

The essential point of the interview for me was like the following:

In order to exploit CRM software enough, a company must optimize its
business activities company wide not per business division basis.
For example, a design center of its products and factories must cooperate
shooting for the maximum benefit of the company not each business division.
Quite a lot of Japanese companies have a problem from that point of view.
Simply speaking, it's a sectionalism among business divisions in one company.

The president talked about the strategy and foresight of his company more, but
for me the above was interesting.
Actually, that story reminded me of what an executive of my company said
at a kickoff meeting of this fiscal year about a month ago.
I'm working for a company with a quite traditional business structure, and
a lot of business divisions inside the company are always competing with
with each other for their own budgets and benefits. It's like a bureau of
something. :(

BUT!

The executive finally began to say, "Think company wide optimization,
not per business unit basis."
Furthermore, about two weeks later of the kickoff meeting, I heard a news that
the executive would be the president of my company soon. :o

The above story also reminded me of a similar issue I wrote before.
I think a big company can be regarded as a society or a community which
consists of multiple organizations with different stakes. Here,
the organizations are like species with different *genes* carriers.
If the genes are essentially different and competing with each other,
the theory of evolution says that it's not stable that those species
cooperate each other. Thus, the problem is that if employees of my company
are sharing the same gene or not.
I joined my company about three years ago after 10 years of life at other
company, and for me their mentality looks like almost uniform one.
So, I believe the competing divisions share the same gene. :)

BTW, the executive of my company is Mr. Yamashita.
Hey, Yamashita-san, I'm really looking forward to seeing your strong
leadership. :)

Sunday, May 06, 2007

Second Life

Humm....

I got an account of Second Life today.
But, its client software hangs up almost every time... :(

What's wrong!?

Saturday, May 05, 2007

Two Years

It's the second wedding anniversary of us today.

As we had a yakiniku party yesterday, we celebrated the anniversary by a small cake and tea party. :)



We bought them at a cake shop "L'ATELIER DE T" in Toyohashi city.
http://home-eat.seesaa.net/article/33427197.html
http://www.planets.co.jp/select/file16.phtml

The owner chef seems to have worked as the chief pâtissier of the Hotel Okura, Hamamatsu.
My choice was the lemon tarte above, and I like it. My mother in law also loved her Mont Blanc. But, surprisingly enough for me, my wife and my father in law didn't like their cakes.

BTW, when we stayed at my home town, my mother also celebrated us by a small cake party.
My choice was a blue berry tarte below. :)



"Kashiharu"
http://www.kashiharu.com/acce06.htm

Friday, May 04, 2007

Yakiniku Restaurant Hanada

Today's dinner was a Yakiniku party (barbecue party) . :)
It's almost 3 years since I went to a yakiniku restaurant.



The restaurant seems to be very famous and they indeed offer very good meats. :)
Here are several articles about the restaurant, Yakiniku Restaurant Hanada.
  • http://www.jangsanet.com/2-yakiniku/mikawa/toyohashi/hanada/hanada.htm
  • http://r.tabelog.com/aichi/rstdtl/23001167/
BTW, about 4 years ago, I went to this yakiniku restaurant almost once a week. :o
I really loved the restaurant, but now I live very far from the place.

BTW, one of my former colleague is planning to have a party at the restaurant.
Hey, Saeki-kun, it's YOU! Are you reading?
I'm looking forward to seeing you guys and eating together there. :)

Nameshi Dengaku

Today's lunch, Nameshi Dengaku (菜めし田楽) at Kiku-So (きく宗) in Toyohashi, Japan. :)
I like it. :)



Nameshi Dengaku is a kind of Miso Dengaku.

Dengaku is a category of Japanese traditional food. http://ja.wikipedia.org/wiki/%E5%91%B3%E5%99%8C%E7%94%B0%E6%A5%BD(Japanese)
Miso is soybean paste.

"Nameshi" can be decomposed into "Na" and "Meshi". Here, "Na" means leafs of Japanese radish, and "Meshi" is rice.

Thus, "Nameshi Dengaku" can be translated like "Dengaku with soybean paste and Rice with Japanese radish".

BTW, Dengaku is a kind of Japanese Festivals.
http://en.wikipedia.org/wiki/Dengaku (English)
http://ja.wikipedia.org/wiki/%E7%94%B0%E6%A5%BD (Japanese)
According to the Japanese Wikipedia page above, the name comes from the festival name because skewers of (Miso) Dengaku looks like the foot gear used in Dengaku festival.

Wednesday, May 02, 2007

Shimada Rose Hill Garden

Shimada city is located in the middle of Shizuoka prefecture, Japan. It faces to the Pacific Ocean, so they have very calm climate and it's a very good place for growing flowers like roses.



"島田市ばらの丘公園" (Shimada-si Bara no Oka Kouen) is a kind of flower park dedicated for roses. They don't have an english organization name, but "Shimada City Rose Hill Garden" would be appropriate, I think.



My mother loves the garden, and she often goes to the place when she got guests.
This time, it's May 2 we went there. Unfortunatelly, it's a bit earlier than the peak of this season. But, there were plenty of beautiful roses in the greenhouse. :)

Moto-chan no Itai Hanashi



Moto-chan no Itai Hanashi (もとちゃんの痛い話)
ISBN 4-04-160010-3
Motoko Arai (新井素子)

Well, there is no English translation of this book. In English literal translation, the title would be something like "Moto-chan's Sore Story."
Motoko Arai is a famous Sci-Fi/Fantasy writer in Japan, and this is her essay when she got a painful disease. As usual her writing style, it's not a mournful hospital diary but a good light essay, so we can share her various interesting thoughts.

Actually, when I went back to my home town in this Golden Week vacation, I found my mother was working on the book, and I was also captured. :o