Solved

2.8: Mode switch v8 <-> v9 possible in process?

Posted on 2004-09-08
10
388 Views
Last Modified: 2013-12-27
Is it possible with Solaris 2.8 to switch between V8 (32bit) and V9 (64 bit) mode within the same process?

I'm aware of some different features (stack bias, etc.), but the V9 ABI doesn't tell anything about how a V8<->V9 switch is done. It must be done in the kernel somewhere, since it's possible to run both V8/ELF32 and V9/ELF64 binaries.

Background: We're having lots of V8 applications here and slowly some of them are running out of mappable shared memory (2GB). It would be nice to have the shared memory routines running in 64 bits (with -xcode=abs32).

Porting all to 64 bits is not an option, since this would require a huge regression testing effort.

(Yes, I know this is a tough one ... )
0
Comment
Question by:stefan73
  • 3
  • 3
  • 2
10 Comments
 
LVL 40

Expert Comment

by:jlevie
ID: 12012112
Seems to me that you should just start up the system in 64bit (V9) mode and convert just the apps that are having problems to 64bit. The 32bit apps should continue to run.
0
 
LVL 38

Expert Comment

by:yuzh
ID: 12012255
I agreed with jlevie's comments. Just add a bit more information. Solaris 8/9 (Sparc) are
64 bit OS, it can run in 64 bit mode only if the hardware (CPU) can support, the old Sparc
CPU can only run in 32-bit mode, most of the Ultra Spac CPU (with latest OBP) can support
64 bit, Ultra Sparc-II or new support 64 bit.

If you want to build 64 bit binary, you need to it in the box can run in 64 bit mode.

0
 
LVL 12

Author Comment

by:stefan73
ID: 12013838
jlevie, yuzh,

Thanks for your comments. Yes, the box is a 64 bit Solaris 2.8. And yes, it might be possible to build the apps in 64bits. The problem is just that those apps are using a common, quite monolithic framework of functions (it's a big billing system in a telco environment), whereas the shmem part is pretty much stand-alone.

Porting the existing libraries of functions to 64bit is not an option, as the effort would be quite similar to porting the entire system, in other words: huge. Can't do that.

There are a couple of options to have more than 2GB of shared memory, all of which don't quite convince me:

- a separate V9 process mapping the shmem, using RPC or IPC to communicate with the rest. The overhead is quite big.

- On-demand mapping of various blocks in a V8 process. Quite slow, and big index structures won't work.

Ideas, anyone?
0
 
LVL 40

Expert Comment

by:jlevie
ID: 12018657
I guess I don't understand "whereas the shmem part is pretty much stand-alone." Is that or is that not an integral part of the "monolithic framework of functions"?

If the part using shmem is stand-alone it would seem that it could be modified to build & run in 64bit mode. However, it that is linked into the mail application that wouldn't be possible and you'd have to an approach like you've outlined.
0
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
LVL 38

Assisted Solution

by:yuzh
yuzh earned 250 total points
ID: 12024120
I would suggest you to try to port the programs which need to use large file (>2GB) and
large amount of memory to 64-bit, and leave the other unchange.
see "Solaris 64-bit Developer's Guide"
http://docs.sun.com/db/doc/806-6543/6jffrdmfd?a=view

You can also try to use "limit" to change the datasize and memorysize, and then start
the 32 bit binay to see if it can help:

Please read: 32-bit binary "4GB Processes in Solaris":
http://www.mpi-sb.mpg.de/~jh/Solaris4GB.html

man limit
to learn more details
0
 
LVL 12

Author Comment

by:stefan73
ID: 12158709
Just returning from a vacation...

jlevie,
> I guess I don't understand "whereas the shmem part is pretty much
> stand-alone." Is that or is that not an integral part of the "monolithic
> framework of functions"?

That wasn't explained clearly enough. The shmem part is modular, the rest is monolithic - just like lots of existing bigger systems. Yes, it's not pretty.

yuzh,

the limit part was quite interesting.
0
 
LVL 40

Accepted Solution

by:
jlevie earned 250 total points
ID: 12162499
> The shmem part is modular, the rest is monolithic

In that case it might be feasible to modify the application so as to allow the shmem part to be built for 64bit.
0
 
LVL 12

Author Comment

by:stefan73
ID: 12274609
OK, although I didn't get the answers I wanted, I'll close regularly.

(BTW: Friend of mine working at Sun said it's impossible - except with the help of a driver)
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Hello fellow BSD lovers, I've created a patch process for patching openjdk6 for BSD (FreeBSD specifically), although I tried to keep all BSD versions in mind when creating my patch. Welcome to OpenJDK6 on BSD First let me start with a little …
I promised to write further about my project, and here I am.  First, I needed to setup the Primary Server.  You can read how in this article: Setup FreeBSD Server with full HDD encryption (http://www.experts-exchange.com/OS/Unix/BSD/FreeBSD/A_3660-S…
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.

706 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now