- scheduler: fix logic that deals with jobs that need > 2GB RAM.

My change of 1 Oct ([22440]) required that such jobs
    be processed with 64-bit apps,
    on the assumption that 32-bit apps have a 2 GB user address space limit.
    However, it turns out this limit applies only to Windows
    (kernel and user mode share the 4GB address space; each gets half).
    On Linux, the split is 3GB user / 1 GB kernel.
    On Mac OS X, user mode and kernel mode have separate address spaces,
    each of them 4 GB.


svn path=/trunk/boinc/; revision=22599
This commit is contained in:
David Anderson 2010-10-27 22:58:16 +00:00
parent 884549c695
commit 40c50852f5
10 changed files with 70 additions and 12 deletions

View File

@ -7571,3 +7571,38 @@ David 22 Oct 2010
client/
work_fetch.cpp
David 26 Oct 2010
- client: linux compile fix
- client: small fix for GPU scheduling
(use anticipated debt instead of STD)
client/
app_start.cpp
cpu_sched.cpp
sim.cpp
client_types.h
David 27 Oct 2010
- scheduler: fix logic that deals with jobs that need > 2GB RAM.
My change of 1 Oct ([22440]) required that such jobs
be processed with 64-bit apps,
on the assumption that 32-bit apps have a 2 GB user address space limit.
However, it turns out this limit applies only to Windows
(kernel and user mode share the 4GB address space; each gets half).
On Linux, the split is 3GB user / 1 GB kernel.
On Mac OS X, user mode and kernel mode have separate address spaces,
each of them 4 GB.
client/
app.cpp
hostinfo_unix.cpp
hostinfo_win.cpp
lib/
coproc.cpp
str_util.h
util.h
sched/
sched_customize.cpp
sched_score.cpp
sched_version.cpp

View File

@ -60,6 +60,7 @@
#include "shmem.h"
#include "str_util.h"
#include "str_replace.h"
#include "util.h"
#include "client_state.h"
#include "client_msgs.h"

View File

@ -100,14 +100,16 @@
#include "win/opt_x86.h"
#endif
#include "client_types.h"
#include "filesys.h"
#include "error_numbers.h"
#include "filesys.h"
#include "str_util.h"
#include "str_replace.h"
#include "util.h"
#include "client_state.h"
#include "hostinfo_network.h"
#include "client_types.h"
#include "client_msgs.h"
#include "hostinfo_network.h"
using std::string;

View File

@ -27,12 +27,14 @@
#include <intrin.h>
#endif
#include "client_types.h"
#include "error_numbers.h"
#include "filesys.h"
#include "str_util.h"
#include "str_replace.h"
#include "util.h"
#include "client_msgs.h"
#include "error_numbers.h"
#include "client_types.h"
#include "hostinfo_network.h"
#include "hostinfo.h"
#include "idlemon.h"

View File

@ -36,7 +36,7 @@
#include "error_numbers.h"
#include "filesys.h"
#include "parse.h"
#include "str_util.h"
#include "util.h"
#include "coproc.h"

View File

@ -25,10 +25,6 @@
#include <string>
#include <vector>
#define KILO (1024.0)
#define MEGA (1048576.0)
#define GIGA (1024.*1048576.0)
extern int ndays_to_string(double x, int smallest_timescale, char *buf);
extern void nbytes_to_string(double nbytes, double total_bytes, char* str, int len);
extern int parse_command_line(char*, char**);

View File

@ -35,6 +35,9 @@ extern void push_unique(std::string, std::vector<std::string>&);
// NOTE: use #include <functional> to get max,min
#define SECONDS_PER_DAY 86400
#define KILO (1024.0)
#define MEGA (1048576.0)
#define GIGA (1024.*1048576.0)
static inline double drand() {
return (double)rand()/(double)RAND_MAX;

View File

@ -50,6 +50,7 @@
// In either case, put your version under source-code control, e.g. SVN
#include "str_util.h"
#include "util.h"
#include "sched_config.h"
#include "sched_main.h"

View File

@ -19,7 +19,7 @@
#include "boinc_db.h"
#include "error_numbers.h"
#include "str_util.h"
#include "util.h"
#include "sched_main.h"
#include "sched_config.h"

View File

@ -360,6 +360,24 @@ static void app_version_desc(BEST_APP_VERSION& bav, char* buf) {
}
}
// different OSs have different max user address space for 32 bit apps
//
static double max_32b_address_space() {
if (strstr(g_request->platform.name, "windows")) {
return 2*GIGA;
} else if (strstr(g_request->platform.name, "linux")) {
return 3*GIGA;
} else if (strstr(g_request->platform.name, "darwin")) {
return 4*GIGA;
} else if (strstr(g_request->platform.name, "solaris")) {
return 4*GIGA;
} else if (strstr(g_request->platform.name, "anonymous")) {
// problem case. assume windows
return 2*GIGA;
}
return 2*GIGA;
}
// return BEST_APP_VERSION for the given job and host, or NULL if none
//
// check_req: check whether we still need work for the resource
@ -378,7 +396,7 @@ BEST_APP_VERSION* get_app_version(
int j;
BEST_APP_VERSION* bavp;
char message[256], buf[256];
bool job_needs_64b = (wu.rsc_memory_bound > 2.1e9);
bool job_needs_64b = (wu.rsc_memory_bound > max_32b_address_space());
if (config.debug_version_select) {
if (job_needs_64b) {