Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_jdk
提交
8cae9bc7
D
dragonwell8_jdk
项目概览
openanolis
/
dragonwell8_jdk
通知
4
Star
2
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
D
dragonwell8_jdk
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
8cae9bc7
编写于
6月 15, 2012
作者:
A
alanb
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
7176485: (bf) Allow temporary buffer cache to grow to IOV_MAX
Reviewed-by: chegar, coffeys
上级
6bb8ec25
变更
9
隐藏空白更改
内联
并排
Showing
9 changed file
with
34 addition
and
34 deletion
+34
-34
make/java/nio/mapfile-linux
make/java/nio/mapfile-linux
+1
-0
make/java/nio/mapfile-solaris
make/java/nio/mapfile-solaris
+1
-0
src/share/classes/sun/nio/ch/IOUtil.java
src/share/classes/sun/nio/ch/IOUtil.java
+14
-2
src/share/classes/sun/nio/ch/Util.java
src/share/classes/sun/nio/ch/Util.java
+1
-1
src/solaris/native/sun/nio/ch/FileDispatcherImpl.c
src/solaris/native/sun/nio/ch/FileDispatcherImpl.c
+0
-6
src/solaris/native/sun/nio/ch/IOUtil.c
src/solaris/native/sun/nio/ch/IOUtil.c
+10
-0
src/windows/native/sun/nio/ch/IOUtil.c
src/windows/native/sun/nio/ch/IOUtil.c
+7
-16
src/windows/native/sun/nio/ch/SocketDispatcher.c
src/windows/native/sun/nio/ch/SocketDispatcher.c
+0
-8
src/windows/native/sun/nio/ch/nio_util.h
src/windows/native/sun/nio/ch/nio_util.h
+0
-1
未找到文件。
make/java/nio/mapfile-linux
浏览文件 @
8cae9bc7
...
...
@@ -88,6 +88,7 @@ SUNWprivate_1.1 {
Java_sun_nio_ch_IOUtil_fdVal;
Java_sun_nio_ch_IOUtil_fdLimit;
Java_sun_nio_ch_IOUtil_initIDs;
Java_sun_nio_ch_IOUtil_iovMax;
Java_sun_nio_ch_IOUtil_makePipe;
Java_sun_nio_ch_IOUtil_randomBytes;
Java_sun_nio_ch_IOUtil_setfdVal;
...
...
make/java/nio/mapfile-solaris
浏览文件 @
8cae9bc7
...
...
@@ -76,6 +76,7 @@ SUNWprivate_1.1 {
Java_sun_nio_ch_IOUtil_fdLimit;
Java_sun_nio_ch_IOUtil_fdVal;
Java_sun_nio_ch_IOUtil_initIDs;
Java_sun_nio_ch_IOUtil_iovMax;
Java_sun_nio_ch_IOUtil_makePipe;
Java_sun_nio_ch_IOUtil_randomBytes;
Java_sun_nio_ch_IOUtil_setfdVal;
...
...
src/share/classes/sun/nio/ch/IOUtil.java
浏览文件 @
8cae9bc7
...
...
@@ -36,6 +36,11 @@ import java.nio.ByteBuffer;
public
class
IOUtil
{
/**
* Max number of iovec structures that readv/writev supports
*/
static
final
int
IOV_MAX
;
private
IOUtil
()
{
}
// No instantiation
static
int
write
(
FileDescriptor
fd
,
ByteBuffer
src
,
long
position
,
...
...
@@ -111,7 +116,8 @@ public class IOUtil {
// Iterate over buffers to populate native iovec array.
int
count
=
offset
+
length
;
for
(
int
i
=
offset
;
i
<
count
;
i
++)
{
int
i
=
offset
;
while
(
i
<
count
&&
iov_len
<
IOV_MAX
)
{
ByteBuffer
buf
=
bufs
[
i
];
int
pos
=
buf
.
position
();
int
lim
=
buf
.
limit
();
...
...
@@ -135,6 +141,7 @@ public class IOUtil {
vec
.
putLen
(
iov_len
,
rem
);
iov_len
++;
}
i
++;
}
if
(
iov_len
==
0
)
return
0L
;
...
...
@@ -240,7 +247,8 @@ public class IOUtil {
// Iterate over buffers to populate native iovec array.
int
count
=
offset
+
length
;
for
(
int
i
=
offset
;
i
<
count
;
i
++)
{
int
i
=
offset
;
while
(
i
<
count
&&
iov_len
<
IOV_MAX
)
{
ByteBuffer
buf
=
bufs
[
i
];
if
(
buf
.
isReadOnly
())
throw
new
IllegalArgumentException
(
"Read-only buffer"
);
...
...
@@ -264,6 +272,7 @@ public class IOUtil {
vec
.
putLen
(
iov_len
,
rem
);
iov_len
++;
}
i
++;
}
if
(
iov_len
==
0
)
return
0L
;
...
...
@@ -336,11 +345,14 @@ public class IOUtil {
static
native
int
fdLimit
();
static
native
int
iovMax
();
static
native
void
initIDs
();
static
{
// Note that IOUtil.initIDs is called from within Util.load.
Util
.
load
();
IOV_MAX
=
iovMax
();
}
}
src/share/classes/sun/nio/ch/Util.java
浏览文件 @
8cae9bc7
...
...
@@ -45,7 +45,7 @@ public class Util {
// -- Caches --
// The number of temp buffers in our pool
private
static
final
int
TEMP_BUF_POOL_SIZE
=
8
;
private
static
final
int
TEMP_BUF_POOL_SIZE
=
IOUtil
.
IOV_MAX
;
// Per-thread cache of temporary direct buffers
private
static
ThreadLocal
<
BufferCache
>
bufferCache
=
...
...
src/solaris/native/sun/nio/ch/FileDispatcherImpl.c
浏览文件 @
8cae9bc7
...
...
@@ -94,9 +94,6 @@ Java_sun_nio_ch_FileDispatcherImpl_readv0(JNIEnv *env, jclass clazz,
{
jint
fd
=
fdval
(
env
,
fdo
);
struct
iovec
*
iov
=
(
struct
iovec
*
)
jlong_to_ptr
(
address
);
if
(
len
>
16
)
{
len
=
16
;
}
return
convertLongReturnVal
(
env
,
readv
(
fd
,
iov
,
len
),
JNI_TRUE
);
}
...
...
@@ -126,9 +123,6 @@ Java_sun_nio_ch_FileDispatcherImpl_writev0(JNIEnv *env, jclass clazz,
{
jint
fd
=
fdval
(
env
,
fdo
);
struct
iovec
*
iov
=
(
struct
iovec
*
)
jlong_to_ptr
(
address
);
if
(
len
>
16
)
{
len
=
16
;
}
return
convertLongReturnVal
(
env
,
writev
(
fd
,
iov
,
len
),
JNI_FALSE
);
}
...
...
src/solaris/native/sun/nio/ch/IOUtil.c
浏览文件 @
8cae9bc7
...
...
@@ -136,6 +136,16 @@ Java_sun_nio_ch_IOUtil_fdLimit(JNIEnv *env, jclass this)
}
}
JNIEXPORT
jint
JNICALL
Java_sun_nio_ch_IOUtil_iovMax
(
JNIEnv
*
env
,
jclass
this
)
{
jlong
iov_max
=
sysconf
(
_SC_IOV_MAX
);
if
(
iov_max
==
-
1
)
iov_max
=
16
;
return
(
jint
)
iov_max
;
}
/* Declared in nio_util.h for use elsewhere in NIO */
jint
...
...
src/windows/native/sun/nio/ch/IOUtil.c
浏览文件 @
8cae9bc7
...
...
@@ -41,9 +41,6 @@ static jfieldID handle_fdID;
/* field id for jint 'fd' in java.io.FileDescriptor used for socket fds */
static
jfieldID
fd_fdID
;
/* false for 95/98/ME, true for NT/W2K */
static
jboolean
onNT
=
JNI_FALSE
;
JNIEXPORT
jboolean
JNICALL
Java_sun_security_provider_NativeSeedGenerator_nativeGenerateSeed
(
JNIEnv
*
env
,
jclass
clazz
,
jbyteArray
randArray
);
...
...
@@ -55,13 +52,6 @@ Java_sun_security_provider_NativeSeedGenerator_nativeGenerateSeed
JNIEXPORT
void
JNICALL
Java_sun_nio_ch_IOUtil_initIDs
(
JNIEnv
*
env
,
jclass
clazz
)
{
OSVERSIONINFO
ver
;
ver
.
dwOSVersionInfoSize
=
sizeof
(
ver
);
GetVersionEx
(
&
ver
);
if
(
ver
.
dwPlatformId
==
VER_PLATFORM_WIN32_NT
)
{
onNT
=
JNI_TRUE
;
}
clazz
=
(
*
env
)
->
FindClass
(
env
,
"java/io/FileDescriptor"
);
fd_fdID
=
(
*
env
)
->
GetFieldID
(
env
,
clazz
,
"fd"
,
"I"
);
handle_fdID
=
(
*
env
)
->
GetFieldID
(
env
,
clazz
,
"handle"
,
"J"
);
...
...
@@ -80,6 +70,13 @@ Java_sun_nio_ch_IOUtil_randomBytes(JNIEnv *env, jclass clazz,
randArray
);
}
JNIEXPORT
jint
JNICALL
Java_sun_nio_ch_IOUtil_iovMax
(
JNIEnv
*
env
,
jclass
this
)
{
return
16
;
}
jint
convertReturnVal
(
JNIEnv
*
env
,
jint
n
,
jboolean
reading
)
{
...
...
@@ -205,9 +202,3 @@ handleval(JNIEnv *env, jobject fdo)
{
return
(
*
env
)
->
GetLongField
(
env
,
fdo
,
handle_fdID
);
}
jboolean
isNT
()
{
return
onNT
;
}
src/windows/native/sun/nio/ch/SocketDispatcher.c
浏览文件 @
8cae9bc7
...
...
@@ -97,10 +97,6 @@ Java_sun_nio_ch_SocketDispatcher_readv0(JNIEnv *env, jclass clazz, jobject fdo,
return
IOS_THROWN
;
}
if
((
isNT
()
==
JNI_FALSE
)
&&
(
len
>
16
))
{
len
=
16
;
}
/* copy iovec into WSABUF */
for
(
i
=
0
;
i
<
len
;
i
++
)
{
jint
iov_len
=
iovp
[
i
].
iov_len
;
...
...
@@ -208,10 +204,6 @@ Java_sun_nio_ch_SocketDispatcher_writev0(JNIEnv *env, jclass clazz,
return
IOS_THROWN
;
}
if
((
isNT
()
==
JNI_FALSE
)
&&
(
len
>
16
))
{
len
=
16
;
}
/* copy iovec into WSABUF */
for
(
i
=
0
;
i
<
len
;
i
++
)
{
jint
iov_len
=
iovp
[
i
].
iov_len
;
...
...
src/windows/native/sun/nio/ch/nio_util.h
浏览文件 @
8cae9bc7
...
...
@@ -35,7 +35,6 @@
jint
fdval
(
JNIEnv
*
env
,
jobject
fdo
);
jlong
handleval
(
JNIEnv
*
env
,
jobject
fdo
);
jboolean
isNT
();
jint
convertReturnVal
(
JNIEnv
*
env
,
jint
n
,
jboolean
r
);
jlong
convertLongReturnVal
(
JNIEnv
*
env
,
jlong
n
,
jboolean
r
);
jboolean
purgeOutstandingICMP
(
JNIEnv
*
env
,
jclass
clazz
,
jint
fd
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录