-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
93 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
#define __ESCA_sendfile 71 | ||
#define __ESCA_shutdown 210 | ||
#define __ESCA_close 57 | ||
#define __ESCA_close 57 | ||
#define __ESCA_write 64 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
#define __ESCA_sendfile 40 | ||
#define __ESCA_shutdown 48 | ||
#define __ESCA_close 3 | ||
#define __ESCA_close 3 | ||
#define __ESCA_write 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
--- old/redis-7.0-rc2/src/networking.c 2022-02-28 21:35:46.000000000 +0800 | ||
+++ new/redis-7.0-rc2/src/networking.c 2022-03-14 18:36:07.198857861 +0800 | ||
@@ -1974,6 +1974,7 @@ | ||
int processed = listLength(server.clients_pending_write); | ||
|
||
listRewind(server.clients_pending_write,&li); | ||
+batch_start(); | ||
while((ln = listNext(&li))) { | ||
client *c = listNodeValue(ln); | ||
c->flags &= ~CLIENT_PENDING_WRITE; | ||
@@ -2008,6 +2009,7 @@ | ||
} | ||
} | ||
} | ||
+batch_flush(); | ||
return processed; | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
--- old/redis-7.0-rc2/src/server.c 2022-02-28 21:35:46.000000000 +0800 | ||
+++ new/redis-7.0-rc2/src/server.c 2022-03-14 20:18:31.540987391 +0800 | ||
@@ -6983,7 +6983,7 @@ | ||
|
||
redisSetCpuAffinity(server.server_cpulist); | ||
setOOMScoreAdj(-1); | ||
- | ||
+ init_worker(0); | ||
aeMain(server.el); | ||
aeDeleteEventLoop(server.el); | ||
return 0; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#!/usr/bin/env bash | ||
|
||
libpath=$(find $(pwd) -type f -name "libdummy.so" | sed 's_/_\\/_g') | ||
webpath=$(readlink --canonicalize web | sed 's_/_\\/_g') | ||
redispath=$1 | ||
|
||
# modify redis | ||
sed -i 's/FINAL_LIBS=-lm/FINAL_LIBS=-lm ${libpath}/' ${redispath}/src/Makefile |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
ssize_t write(int fd, const void* buf, size_t count) | ||
{ | ||
#if 1 | ||
if (!in_segment) { | ||
return real_write(fd, buf, count); | ||
} | ||
#endif | ||
int idx = this_worker_id * RATIO + (fd % RATIO); | ||
|
||
batch_num++; | ||
|
||
int i = table[idx]->tail_table; | ||
int j = table[idx]->tail_entry; | ||
|
||
table[idx]->user_tables[i][j].sysnum = __ESCA_write; | ||
table[idx]->user_tables[i][j].nargs = 3; | ||
table[idx]->user_tables[i][j].args[0] = fd; | ||
table[idx]->user_tables[i][j].args[1] = buf; | ||
table[idx]->user_tables[i][j].args[2] = count; | ||
|
||
update_index(idx); | ||
|
||
esca_smp_store_release(&table[idx]->user_tables[i][j].rstatus, BENTRY_BUSY); | ||
|
||
/* assume success */ | ||
return count; | ||
} |