Merge branch 'master' of git.lfbs.rwth-aachen.de:metalsvm
This commit is contained in:
commit
80014ec135
6 changed files with 29 additions and 23 deletions
|
@ -142,7 +142,7 @@ int laplace(void *arg)
|
|||
NewValues = (volatile DATA **)kmalloc((N + 2) * sizeof(DATA *));
|
||||
#if USE_STRONG
|
||||
NewValues[0] = (DATA *) svmmalloc((N + 2) * (M + 2) * sizeof(DATA), SVM_STRONG);
|
||||
#elif USE_LATYRELEASE
|
||||
#elif USE_LAZYRELEASE
|
||||
NewValues[0] = (DATA *) svmmalloc((N + 2) * (M + 2) * sizeof(DATA), SVM_LAZYRELEASE);
|
||||
#else
|
||||
NewValues[0] = (DATA *) kmalloc((N + 2) * (M + 2) * sizeof(DATA));
|
||||
|
@ -151,7 +151,7 @@ int laplace(void *arg)
|
|||
OldValues = (volatile DATA **)kmalloc((N + 2) * sizeof(DATA *));
|
||||
#if USE_STRONG
|
||||
OldValues[0] = (DATA *) svmmalloc((N + 2) * (M + 2) * sizeof(DATA), SVM_STRONG);
|
||||
#elif USE_LATYRELEASE
|
||||
#elif USE_LAZYRELEASE
|
||||
OldValues[0] = (DATA *) svmmalloc((N + 2) * (M + 2) * sizeof(DATA), SVM_LAZYRELEASE);
|
||||
#else
|
||||
OldValues[0] = (DATA *) kmalloc((N + 2) * (M + 2) * sizeof(DATA));
|
||||
|
@ -223,17 +223,11 @@ int laplace(void *arg)
|
|||
for (i = 1; i < n + 1; i++) {
|
||||
// over all rows
|
||||
for (j = 1; j < m + 1; j++) {
|
||||
#if 1
|
||||
NewValues[I + i][J + j] =
|
||||
(OldValues[I + i - 1][J + j] +
|
||||
OldValues[I + i + 1][J + j] +
|
||||
OldValues[I + i][J + j - 1] +
|
||||
OldValues[I + i][J + j + 1]) / 4;
|
||||
//if ( NewValues[I+i][J+j] < 0.0 ) NewValues[I+i][J+j] = 0.0 * FIX;
|
||||
//else if ( NewValues[I+i][J+j] > 255.0 ) NewValues[I+i][J+j] = 255.0 * FIX;
|
||||
#else
|
||||
NewValues[I + i][J + j] = 25 * (DATA) (my_rank + 1);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
#if USE_LAZYRELEASE
|
||||
|
@ -245,7 +239,6 @@ int laplace(void *arg)
|
|||
NewValues = OldValues;
|
||||
OldValues = tmp;
|
||||
|
||||
//RCCE_TNS_barrier(&RCCE_COMM_WORLD);
|
||||
RCCE_barrier(&RCCE_COMM_WORLD);
|
||||
|
||||
#ifdef _USE_GFX
|
||||
|
@ -269,6 +262,8 @@ int laplace(void *arg)
|
|||
GFX_draw_data((char *)(BufValues[0]), (N) * (M));
|
||||
GFX_update();
|
||||
}
|
||||
|
||||
RCCE_barrier(&RCCE_COMM_WORLD);
|
||||
#endif
|
||||
// END ITERATIONS LOOP
|
||||
}
|
||||
|
|
|
@ -159,7 +159,7 @@ static int iRCCE_mail_fetch(
|
|||
* write out the data.
|
||||
*/
|
||||
//------------------------------------------------------------------------------
|
||||
iRCCE_MAIL_HEADER dummy_header = {0, 0, 0, NULL, 0, 0, 0, {[0 ... iRCCE_MAIL_HEADER_PAYLOAD-1] = 0} };
|
||||
static iRCCE_MAIL_HEADER dummy_header = {0, 0, 0, NULL, 0, 0, 0, {[0 ... iRCCE_MAIL_HEADER_PAYLOAD-1] = 0} };
|
||||
|
||||
|
||||
static int iRCCE_mailbox_check(void) {
|
||||
|
|
|
@ -116,7 +116,7 @@ int socket_init(vfs_node_t* node, const char* name)
|
|||
return -ENOMEM;
|
||||
|
||||
memset(new_node, 0x00, sizeof(vfs_node_t));
|
||||
new_node->type = FS_CHARDEVICE;
|
||||
new_node->type = FS_SOCKET;
|
||||
new_node->open = &socket_open;
|
||||
new_node->close = &socket_close;
|
||||
new_node->read = &socket_read;
|
||||
|
|
22
fs/fs.c
22
fs/fs.c
|
@ -34,11 +34,16 @@ ssize_t read_fs(fildes_t* file, uint8_t* buffer, size_t size)
|
|||
if (BUILTIN_EXPECT(!node || !buffer, 0))
|
||||
return ret;
|
||||
|
||||
spinlock_lock(&node->lock);
|
||||
// Has the node got a read callback?
|
||||
if (node->type != FS_SOCKET) {
|
||||
spinlock_lock(&node->lock);
|
||||
// Has the node got a read callback?
|
||||
if (node->read != 0)
|
||||
ret = node->read(file, buffer, size);
|
||||
spinlock_unlock(&node->lock);
|
||||
} else {
|
||||
if (node->read != 0)
|
||||
ret = node->read(file, buffer, size);
|
||||
spinlock_unlock(&node->lock);
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
@ -51,11 +56,16 @@ ssize_t write_fs(fildes_t* file, uint8_t* buffer, size_t size)
|
|||
if (BUILTIN_EXPECT(!node || !buffer, 0))
|
||||
return ret;
|
||||
|
||||
spinlock_lock(&node->lock);
|
||||
// Has the node got a write callback?
|
||||
if (node->type != FS_SOCKET) {
|
||||
spinlock_lock(&node->lock);
|
||||
// Has the node got a write callback?
|
||||
if (node->write != 0)
|
||||
ret = node->write(file, buffer, size);
|
||||
spinlock_unlock(&node->lock);
|
||||
} else {
|
||||
if (node->write != 0)
|
||||
ret = node->write(file, buffer, size);
|
||||
spinlock_unlock(&node->lock);
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
|
|
@ -29,12 +29,13 @@
|
|||
#include <metalsvm/stddef.h>
|
||||
#include <metalsvm/spinlock_types.h>
|
||||
|
||||
#define FS_FILE 0x01
|
||||
#define FS_DIRECTORY 0x02
|
||||
#define FS_CHARDEVICE 0x03
|
||||
#define FS_FILE 0x01
|
||||
#define FS_DIRECTORY 0x02
|
||||
#define FS_CHARDEVICE 0x03
|
||||
//#define FS_BLOCKDEVICE 0x04
|
||||
//#define FS_PIPE 0x05
|
||||
//#define FS_SYMLINK 0x06
|
||||
#define FS_SOCKET 0x06
|
||||
//#define FS_MOUNTPOINT 0x08 // Is the file an active mountpoint?
|
||||
|
||||
|
||||
|
|
|
@ -1108,13 +1108,13 @@ void update_load(void)
|
|||
|
||||
spinlock_irqsave_lock(&runqueues[core_id].lock);
|
||||
runqueues[core_id].load[0] *= EXP_1;
|
||||
runqueues[core_id].load[0] += (runqueues[core_id].nr_tasks *FIXED_1) * (FIXED_1 - EXP_1);
|
||||
runqueues[core_id].load[0] += (runqueues[core_id].nr_tasks * FIXED_1) * (FIXED_1 - EXP_1);
|
||||
runqueues[core_id].load[0] >>= FSHIFT;
|
||||
runqueues[core_id].load[1] *= EXP_5;
|
||||
runqueues[core_id].load[1] += (runqueues[core_id].nr_tasks *FIXED_1) * (FIXED_1 - EXP_5);
|
||||
runqueues[core_id].load[1] += (runqueues[core_id].nr_tasks * FIXED_1) * (FIXED_1 - EXP_5);
|
||||
runqueues[core_id].load[1] >>= FSHIFT;
|
||||
runqueues[core_id].load[2] *= EXP_15;
|
||||
runqueues[core_id].load[2] += (runqueues[core_id].nr_tasks *FIXED_1) * (FIXED_1 - EXP_15);
|
||||
runqueues[core_id].load[2] += (runqueues[core_id].nr_tasks * FIXED_1) * (FIXED_1 - EXP_15);
|
||||
runqueues[core_id].load[2] >>= FSHIFT;
|
||||
spinlock_irqsave_unlock(&runqueues[core_id].lock);
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue