Sunday, July 22, 2007

Jacasse

Jacasse is an Italian restaurant in Gotemba Premium Outlets.
Here are several snapshots when we had lunch there.
I think they serve standard quality dishes in Japan...



Gotemba Premium Outlets : Act1

Well, Gotemba Premium Outlets was the most important place to visit in this trip. :o



Fortunately, the weather got better on Sunday, so we, especially my wife :o, enjoyed shopping there.

Here is a picture of things she got today. :o


  • A pair of shoes (Cole Haan)
  • A bag (BALLY)
  • A purse for my wife's mother (BALLY)


Well, what I bought?

Nothing! :o

Actually, I kept sitting on a bench and reading Harry Potter and the Deathly Hallows while she was enjoying (absorbed in?) shopping. :o

A Car Through the Looking Glass?

We made a small trip to Hakone.

Here is an interesting picture took on our way to Hakone. :o



My car is in the center of the mirror(?).
Well, of course, it's my wife who took the picture. :)

Wrote on July 24, 2007.

Saturday, July 21, 2007

Harry Potter and the Deathly Hallows



Harry Potter and the Deathly Hallows
J.K. Rowling
ISBN 978-0-7475-9105-4

Got one with 1 day behind. :)
I guess I would need about 1 week or 10 days or so to finish that.

Friday, July 20, 2007

Hormone Center Dougen

Today, I met several old friends when I worked for the previous company.
It's like an alumni meeting at a barbecue restaurant. :o

Around the building where I worked through the nights many times, there is a very good Beef barbecue restaurant, Hormone Center Dougen (ホルモンセンターどうげん).
Here is a map.

Among high quality but not so expensive dishes of them, actually the best one I think is their Cold noodle (冷麺) . Actually, I've dreamed of the noodle for two years!



Finally, my dream comes true. :o

Wednesday, July 18, 2007

Bodaiju no Kage



Bodaiju no Kage (菩提樹の陰)
Kansuke Naka
ISBN4-00-310513-3

There seems to be no English translation of this book. I'm not sure its English title,
but it would be something like "Umbra of Buddah Tree."

Actually, Kansuke Naka is the author of "The Silver Spoon" (Gin no Saji, 銀の匙) which the title of this Blog comes from. :)

Nintendo DS

Recently, my wife bought a Nintendo DS Lite, and now she is enjoying "Professor Layton and the Strange City."

It's an RPG where a player has to solve puzzles or answer quizzes to go forward.
Although I had almost no interest in so far, I like this game.

BTW, she solved about 80 puzzles out of 120 in total at this moment, and I'm asked to solve difficult ones (for her) about five times a day. :o

Monday, July 16, 2007

A Communication Device: Stethoscope

Today, I bought a special device for communication with thatsdone 3.0
at Newton Style in Musashi-Murayama Diamond City Mu.

Here is a picture of the device. :o



But the problem is, this is just a toy and it's difficult to hear her heartbeat. :(

NINA's PARIS

Today's lunch at NINA's PARIS in Musashi Murayama Diamond City Mu.



A Taco Rice and a dessert. :)

Menya Kotaro(2)

Today's dinner at Menya Kotaro. :)



Green Kotaro Ramen with a half cooked egg.
Green means 'green chili', and it's like a Thai cuisine. :o

Friday, July 13, 2007

The Enemy Is the Pirate: Eye of Justice



Teki ha Kaizoku, Seigi no Me (敵は海賊・正義の眼)
Chohei Kanbayashi
ISBN978-4-15-030893-3
Bought on 2007/07/12
Finished on 2007/07/13

Chohei Kanbayashi is one of the best Japanese Sci-Fi writers, and this is the 7th book of his "The Enemy Is the Pirate" series.

There are no translations of the series, but its English title would be "The Enemy Is the Pirate: Eye of Justice." Actually, there is an OVA DVD of the 2nd book, "The Enemy Is the Pirate: Banquet of Cats", and I guess it's close enough.

BTW, one reason I like the series is that I love two space ships, Rajendra and Kali Durga that play very important roles in the series. Both of them have very advanced A.I. systems, and they have emotion. I like especially Rajendra's personality. :)

Monday, July 09, 2007

A Pillow

Recently my wife bought a pillow.



Today, it's delivered and I was astonished... :o

Almost 25 Weeks



Thatsdone 3.0 is almost 25 weeks today.
24 weeks and 6 days, and weight is 965g.
In addition, today the baby turned out to be a girl. :)

BTW, the girl seems to be 2 weeks ahead of common baby.
Maybe a giant child. :o

Sunday, July 08, 2007

Long Wang



Long Wang (龍王) is a Chinese restaurant along Shin-Koganei Kaido avenue (新小金井街道).
  • Ramen with meat and vegetables boiled in soy sauce with sugar (旨煮ラーメン)
  • potsticker (餃子 )
I think it's average level, but compared to ones of other Ramen restaurants along the avenue, it's difficult to find out things to distinguish it. :(

Thursday, July 05, 2007

Guin Saga Extra 21

Guin Saga Extra 21 : The Warrior in Wonderland
Kaoru Kurimoto
ISBN978-4-15-030894-0

Wow, Guin finally got the Guin 2.0!

Wednesday, July 04, 2007

Alchemist

Alchemist
Paulo Coelho
ISBN978-4-04-275001-X (Japanese translation)

Tuesday, July 03, 2007

Summer Vacations 2007

Well, it turned out that I had to have 8.5 days off by the end of this September at work.
In addition, I have 5 more days special summer vacation. :o
As I wrote before several times, now I'm working for a veeeeery bureaucratic company. They have also one of the strongest union in Japan because of a historical background. In addition, the union is bureaucratic too. :(
That means employees are asked to follow union's regulations not only the employer even an employee do not want to have days off.

Thus, I was forced (!?) to have big vacations this year.
One is 9 days vacation in August and the other is 11 days one. :)
The only thing I regret of a bit is that it's difficult to travel abroad because my wife cannot come with me because of the upcoming baby in October. :)

Saturday, June 30, 2007

Fan

At work, my desk is located at a very hot place. :(
It means just it's far from the duct of air conditioning, but anyway I don't feel like doing anything there. :(

Here is my solution. :o

YUASA "FAN TERIOR" YFC-18H(GN) -- \1,280- at Kodaira Kojima
A 18cm desktop (partition top?) fan. :)

Ramen Jinanbo



Well, tonight dinner at Ramen Jinanbo (らーめん 次男坊).
My choice was a pork soup ramen with green onion, boiled egg and sliced roasted black pork.
I like it very much.

Hey Harada-san, this restaurant seems to be affiliated with Tamazou (たまぞう) in Fuchu city.
I believe you will also like it. :)

Friday, June 29, 2007

HA Again

Well, this time, it's about a High Availability Cluster System issue, not a Human Assesment training. :o

Sun Microsystems seems to have decided to make their HA cluster software, Solaris Cluster, open source. (Available here)
Some colleagues of mine are working on heartbeat, but practically speaking it's a troublesome software unfortunatelly. Indeed, one of the best engineers among us (Hey Takenaka-san, it's you :) is always captured by troubles of hearbeat. :(

I'm wondering why they don't choose that. :o

ThinkPad X61 : Act4

Let's go setting up the hardware anyway. :)

Act 4-1. Plugging in the memory extension module

First of all, I need more memory. :o



2G bytes in total. :)

Act 4-2. Astonishing fact

Here is a picture of ThinkPad X31 and X61 AC adaptor connectors.
Well, in short, X31 is DC 16V and X61 is DC 20V.
I should have bought one more AC adaptor... :(



Act 4-3. Power ON!

Left is X31 and right is X61. :)

Thursday, June 28, 2007

ThinkPad X61 : Act3



Finally delivered! :o

But, today I was busy at work and got home very late. :(
It's tomorrow work...

Monday, June 25, 2007

OLS2007

Tomorrow morning, a colleague of mine sets for Ottawa to attend at Ottawa Linux Symposium, 2007. I really wanted to be there too. But, this time, his turn, and I'm looking forward to seeing the colleague being touched off very much. :)

BTW, while looking at the time table of the symposium this year, I was grabbed by one presentation, "GANESHA: A Multi-Usage Large Cache NFSv4 Server" by Philippe Deniel.

Well, Ganesha is one of the most popular Hindi deities.
You can find several pictures in Wikipedia.
Yes, actually she looks like a pink elephant. :o

The colleague is very familiar with NFS architecture, and I hope he will enjoy the presentation.

Here is a brief list of the presentations I want to hear.
  • "Keeping Kernel Performance from Regressions" by Tim Chen
  • "Why Virtualization Fragmentation Sucks" by Justin M Forbe
  • "Ptrace, Utrace, Uprobes: Lightweight, Dynamic Tracing of User Apps" by James A. Keniston
  • "Kernel Scalability: Expanding the Horizon Beyond Fine Grain Locks" by Corey D Gough
  • "KDDM: A Generic Basis For Distributed Kernel Infrastructure" by Renaud Lottiaux
  • "Precise Process Accounting: Improving CPU Utilization in the Linux OS for Mission Critical Environments" by Mario Smarduch

22 Weeks

Well, now thatsdone 3.0 is 22 weeks and 6 days and 735g. :)

I want a boy, but the doctor says the baby looks like a girl.
Anyway it's OK so far as the baby comes on the world without any trouble. :)

Sunday, June 24, 2007

FAT Filesystem and Timestamp

I found an old friend of mine wrote an interesting article about FAT filesystem timestamp handling in Linux.

Summary (in Japanese) is here, and his points (in English) are:
  • Linux FAT filesystem implementation interprets timestamps as localtime where the kernel is running
  • Linux kernel gets timezone information from the user land via settimeofday() system call
  • The FAT filesystem translates the localtime timestamps into epoc (GMT) format on request of stat() system call.
  • ls command translates the epoc format timestamps derived via stat() system call into localtime format AGAIN! :o
Thanks JR0BAK for the interesting issue! :)


BTW, note that 'ctime' of POSIX is 'Change time' not 'Create time', thus in principle it's impossible to know when a file was created under general UNIX environment.

Meadow and Mew (take 1)

On Windows, I usually edit text files using Meadow and read/write e-mails
using mew. They are pretty good for me. :)

So far, I kept using a bit older versions.

Today, finally I began to upgrade them to:

And here is a brief list of problems:

  • global gtags mode does not work under Meadow 3.0 :(
  • ispell doesn't work :(
    • It complains language environment.
  • packing folders of mew seems to be obsolete.
    • This is against my custom. :(
  • mew 3.2 and 5.2 requires different versions of ImageMagick
    • They cannot coexist as they require PATH not 'exec-path'. :(
Anyway, I need some time to fix the upgrading problems and the older versions have to co-exist some more time...


Saturday, June 23, 2007

Linux World Memorial DVD Book 2001-2007



Linux World Memorial DVD Book 2001-2007
Magazine Code: 61503-71
ISBN978-4-87280-271-9

Well, I didn't buy this issue.
Last year, I wrote an article for the magazine and I got this issue for free as one of the authors. :o

What kind of article?
Please find out that. :)

Friday, June 22, 2007

ThinkPad X61 : Act2



The extension battery set was delivered today ahead of the X61 itself.
A bit surprised by the size of the box. :o

HA?

I had a two days Human Assessment training course at work.
This course is intended for people shooting for being or expected to be a manager.
When my boss asked me to have the course, I asked him like "Hua? Is that a High Availability training course? Perhaps, I will be redundant and I can have a standby instance of myself?" :o

BTW, want to be a manager?

No way. :o

Wednesday, June 20, 2007

A Burning Project

From this April, I was assigned to a special task force team intended for trouble shooting of IT systems, and from this April I'm working with a troublesome project that has already cut over from their previous system last year.

Since my team joined to the trouble shooting of the project, we pointed out several technical problems ans their solutions. But, the customer does not seem to like to change their current configuration parameters.

Yes, the essential problem is not technical ones but ones of process. :(

In other word, none of them does not want to make decisions.
Furthermore, for me they look like that they don't want to take responsibilities doing so.
IMHO, that's why the project is burning.

BTW, the direct customer of my team is not the customer above, but a system integrator that built the system for the customer. The system integrator team is also trouble some in the same sense. I mean a system integrator SHOULD show the correct way to operate a system and persuade the customer to convince what is correct even the correct solution has risks somehow.
But, the project team of the system integrator accepts whatever the customer says like a slave. :(
Sometimes I speak with colleagues of mine, "Perhaps they (the project team of the system integrator) are masochistic?" :o

That's another problem of process.

What can I do for them?

Monday, June 18, 2007

DesignWave Magazine '07/07

Today, I bought a DesignWave Magagine, 2007/07.

Well, it's a Japanese managine intended for hardware engineers.
This issue includes an FPGA board with Xilinx Spartan-3E.
As I wrote in this entry, I got an NEC V850 board 2 months ago, and I'm thinking to build a reconfigurable embedded system using the V850 board and Spartan-3E board.

But, the problem is that still I cannot make enough spare time to play with the boards. :(

Hennesy and Patterson 4th edition



Computer Architecture, Fourth Edition: A Quantitative Approach
John L. Hennessy (Author), David A. Patterson
ISBN: 978-0123704900

I bought this book on Saturday (June 16) and it's delivered on Monday(June 18). :o
Amazing, Amazon... :o

Note:
Corrected the subject from "P... and H..." to "H... to P..." (2007/06/25)

Sunday, June 17, 2007

Scratch

My car got a scratch...orz :(

A New Ramen Restaurant



As I wrote before, Shin-Koganei-Kaido(avenue) is called as Ramen Kaido(avenue).

Today, another new Ramen restaurant, Jinan-bo(次男坊) opened next to Menya Kotaro.
I'm wondering if they can really do well under a close-packed situation.

Jinan-bo(次男坊) means 'the second boy (in a family)', and I guess the chef must have learnt at some famous Ramen restaurant. Maybe Harada-san can tell me the details. :)

BTW, my gourmet report?
Not yet, and stay tuned. :o

Friday, June 15, 2007

ThinkPad X61 : Act1

Well, I like ThinkPad very much.

Actually, I bought 4 ThinkPads in these 10 years. :o
  • ThinkPad 230CS
  • ThnkPad 535X
  • ThinkPad 560
  • ThinkPad X31
The last one, ThinkPad X31 worked really good for me.
But, in these days I've been feeling a bit inconvenient because PentiumM does not support PAE mode and I want a mobile 64bit with virtualization environment.
At work, several weeks ago two colleagues of mine bought ThinkPad X60, and I also requested for decision for my wife and got one immediately. :o
I'm not sure it was unfortunate or not now, but anyway I've been very busy for these two months and could not make time to place an order. :(

Recently, when I got time finally to do so, it turned out that now ThinkPad X61's available, and finally I placed an order today. I'm really looking forward to having the new one. :)

Thursday, June 14, 2007

Quicken

Today, I felt thatsdone 3.0 is moving in the womb for the first time.
It's amazing...

To tell the truth, I thought "Oh my god, it's as if there is an creature in the womb."
But, this is the case. :o

Saturday, June 09, 2007

20 Weeks



Finally, thatsdone 3.0 is 20 weeks (and three days).
Our doc says, "Hum... maybe this baby is a girl." But, not determined yet...
Anyway, the baby passed the 20 weeks barrier which thatsdone 2.0 could not go through.
Thus, we are happy today. :)

Friday, June 08, 2007

Guin Saga 114

Guin Saga 114
The Crypt of the Crimson Crane
ISBN 978-4-15-030891-9

114!

But, the story develops veeeery slowly in this volume.

I like more rapid development. :(

Note: Bought on June 8 and finished on June 9.


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