topics

全部话题 - 话题: blocksize
(共0页)
l****1
发帖数: 215
1
用mkfs.xfs -b size=65536 -f [device]格式化分区,然后用blockdev –getbsz [
device]检查blocksize,结果总是4096,谁有经验?
我的系统是CentOS 5.5 32bit.
m********6
发帖数: 58
2
来自主题: JobHunting版 - 攒人品发Google onsite面经
SESSION1 的体,我觉得不用SORT。 只要在无法完成8bytes的时候swap即可。
public static void optimize(int[] fields)
{
int blockStart = 0;
int blockSize = 0;
for (int i = 0; i < fields.length; i++)
{
blockSize += fields[i];
if (blockSize % 8 == 0)
{
blockStart = i + 1;
blockSize = 0;
}
else if (blockSize > 8)
{
blockStart = rearrange(fields, blockStart, i);
... 阅读全帖
F*********k
发帖数: 42
3
好的,谢谢谢谢,我想我大概明白了,
我之前没看明白 FixedAllocator::Chunk::Deallocate 里边的
*toRelease = firstAvailableBlock_; 这句
其实这句实际上把当前和之前的连接起来了。
我把源码贴这里
void FixedAllocator::Chunk::Reset(std::size_t blockSize, unsigned char
blocks)
{
assert(blockSize > 0);
assert(blocks > 0);
// Overflow check
assert((blockSize * blocks) / blockSize == blocks);
firstAvailableBlock_ = 0;
blocksAvailable_ = blocks;
unsigned char i = 0;
unsigned char* p = pData_;
for (; i != blocks; p += blockSize)
... 阅读全帖
h********0
发帖数: 74
4
来自主题: JobHunting版 - GF面经
how about this, a java version
static int BLOCKSIZE = 4096;
/*
* 内部有个静态文件指针,只能向文件末尾移动,每次只能读取4K的block到buf里,
* 返回读取的字节数(除非到文件尾,否则总是4K)
*/
private int read4096(byte[] buf) {
//this is a fake
return Math.random() > 0.9 ? 1024 : 4096;
}
/**
* read bytes and fill in the contain of 'output'
*
* Testcases:
* 1 just want to read 3k, it < 4k, and the file is enough
* 2 just want to read 5k, 4k < it < 8k, and the file is enough
* 3 want too much, read all rem... 阅读全帖
c*********d
发帖数: 9770
5
来自主题: Military版 - 袁岚峰 中国科学技术大学
https://zhuanlan.zhihu.com/p/36982992
袁岚峰
中国科学技术大学 微尺度物质科学国家实验室副研究员
关注风云之声提升思维层次
解读科学,洞察本质
戳穿忽悠,粉碎谣言
导读
联想2年前5G编码标准投票的历史被重提,“联想导致华为在投票中输给高通”成为群
众关注焦点。本文希望能还原一些事件真相,3GPP不存在所谓的投票定输赢的机制。联
想第二次会议中的异常行为对会议进程没有任何影响,并非华为方案没有通过的原因。
——————————————————————————————————————
联想2年前5G编码标准投票的历史,被旧事重提,“联想导致华为在投票中输给高通”
成为群众关注焦点。在中美正在进行贸易战与技术战争的背景下,联想受到了很大的舆
论压力,创始人柳传志都出来公开发声。
其实5G编码2016年底就有新闻,当时的说法是华为与西方列强斗争,主导的Polar码成
功成为国际编码标准。有一些了解技术的人还出来辟谣,说不是这回事,Polar码不是
华为发明的,也没有象吹的那样打败了对手。没想到2018年又被翻出来,但是说法却反
过来了,说华为5G编码之争... 阅读全帖
l*********8
发帖数: 4642
6
来自主题: JobHunting版 - Rotating an array in place
Another method (Block swap algorithm for array rotation):
void swapBlock(int a[], int block1, int block2, int blockSize)
{
int block1End = block1 + blockSize;
while (block1 < block1End) {
int tmp = a[block1];
a[block1++] = a[block2];
a[block2++] = tmp;
}
}
void leftRotate(int a[], size_t N, int k)
{
if (N<2) return;
k = (k%N + N) % N;
if (k == 0) return;
int start = 0; // start index of unprocessed array
int end = N; // end index of unprocessed array
int leftK ... 阅读全帖
z**r
发帖数: 17771
7
来自主题: Linux版 - linux下有啥dvd->iso的软件么?
没觉得ws,俺意思是正版的都有加密保护,用dd可能够呛
俺试过缺省的blocksize,也一样结果,但是很慢,所以要等很久才出结果,所以就把
blocksize调大,结果出来快。不过这个跟盘子稳定性没有关系吧
而且俺用k9copy就可以很轻松rip出来,dd就不行
p*********e
发帖数: 32207
8
builderFactory = org.apfloat.internal.IntBuilderFactory
maxMemoryBlockSize = 201326592
cacheL1Size = 8192
cacheL2Size = 262144
cacheBurst = 32
memoryTreshold = 201326592
sharedMemoryTreshold = 786432
blockSize = 134217728
numberOfProcessors = 8
Calculating pi to 1000000 radix-10 digits
Using up to 8 parallel operations for calculation
Using the Chudnovsky brothers' binary splitting algorithm
100% complete, elapsed time 3.978 seconds
Final value took 0.826 seconds
Total elapsed time 4.852 seconds... 阅读全帖
b**l
发帖数: 33123
9
我老这个才是极品:
builderFactory = org.apfloat.internal.IntBuilderFactory
maxMemoryBlockSize = 201326592
cacheL1Size = 8192
cacheL2Size = 262144
cacheBurst = 32
memoryTreshold = 201326592
sharedMemoryTreshold = 3145728
blockSize = 134217728
numberOfProcessors = 2
Calculating pi to 1000000 radix-10 digits
Using up to 2 parallel operations for calculation
Using the Chudnovsky brothers' binary splitting algorithm
100% complete, elapsed time 17.922 seconds
Final value took 3.125 seconds
Total elapsed time 2... 阅读全帖
p***r
发帖数: 1098
10
builderFactory = org.apfloat.internal.IntBuilderFactory
maxMemoryBlockSize = 100663296
cacheL1Size = 8192
cacheL2Size = 262144
cacheBurst = 32
memoryTreshold = 100663296
sharedMemoryTreshold = 393216
blockSize = 67108864
numberOfProcessors = 8
Calculating pi to 1000000 radix-10 digits
Using up to 8 parallel operations for calculation
Using the Chudnovsky brothers' binary splitting algorithm
100% complete, elapsed time 2.083 seconds
Final value took 0.584 seconds
Total elapsed time 2.672 seconds
... 阅读全帖
d********e
发帖数: 1468
11
builderFactory = org.apfloat.internal.IntBuilderFactory
maxMemoryBlockSize = 201326592
cacheL1Size = 8192
cacheL2Size = 262144
cacheBurst = 32
memoryTreshold = 201326592
sharedMemoryTreshold = 1572864
blockSize = 134217728
numberOfProcessors = 4
Calculating pi to 1000000 radix-10 digits
Using up to 4 parallel operations for calculation
Using the Chudnovsky brothers' binary splitting algorithm
100% complete, elapsed time 2.87 seconds
Final value took 0.53 seconds
Total elapsed time 3.4 seconds
i5... 阅读全帖
n*******e
发帖数: 4894
12
builderFactory = org.apfloat.internal.IntBuilderFactory
maxMemoryBlockSize = 201326592
cacheL1Size = 8192
cacheL2Size = 262144
cacheBurst = 32
memoryTreshold = 201326592
sharedMemoryTreshold = 1572864
blockSize = 134217728
numberOfProcessors = 4
Calculating pi to 1000000 radix-10 digits
Using up to 4 parallel operations for calculation
Using the Chudnovsky brothers' binary splitting algorithm
100% complete, elapsed time 2.522 seconds
Final value took 0.458 seconds
Total elapsed time 2.986 second... 阅读全帖
d********e
发帖数: 1468
13
builderFactory = org.apfloat.internal.IntBuilderFactory
maxMemoryBlockSize = 201326592
cacheL1Size = 8192
cacheL2Size = 262144
cacheBurst = 32
memoryTreshold = 201326592
sharedMemoryTreshold = 786432
blockSize = 134217728
numberOfProcessors = 8
Calculating pi to 1000000 radix-10 digits
Using up to 8 parallel operations for calculation
Using the Chudnovsky brothers' binary splitting algorithm
100% complete, elapsed time 2.62 seconds
Final value took 0.6 seconds
Total elapsed time 3.22 seconds
i7-... 阅读全帖
s*****a
发帖数: 1269
14
builderFactory = org.apfloat.internal.IntBuilderFactory
maxMemoryBlockSize = 201326592
cacheL1Size = 8192
cacheL2Size = 262144
cacheBurst = 32
memoryTreshold = 201326592
sharedMemoryTreshold = 6291456
blockSize = 134217728
numberOfProcessors = 1
Calculating pi to 1000000 radix-10 digits
Using the Chudnovsky brothers' binary splitting algorithm
100% complete, elapsed time 62.062 seconds
Final value took 11.813 seconds
Total elapsed time 73.985 seconds
G*F
发帖数: 427
15
builderFactory = org.apfloat.internal.IntBuilderFactory
maxMemoryBlockSize = 201326592
cacheL1Size = 8192
cacheL2Size = 262144
cacheBurst = 32
memoryTreshold = 201326592
sharedMemoryTreshold = 786432
blockSize = 134217728
numberOfProcessors = 8
Calculating pi to 1000000 radix-10 digits
Using up to 8 parallel operations for calculation
Using the Chudnovsky brothers' binary splitting algorithm
100% complete, elapsed time 3.336 seconds
Final value took 0.761 seconds
Total elapsed time 4.105 seconds... 阅读全帖
x*z
发帖数: 1010
16
来自主题: Linux版 - linux下有啥dvd->iso的软件么?
呵呵,当然是原版的,我这就是做原版备份用的,不要把人都想得那么ws,
做个备份一是方便在电脑上看,不用每次到处找盘,二是盘子过不了多久
就会出你的这个问题了(坏了:-D),而且dup dvd的时候不推荐用64M那么
大的blocksize,因为很多盘子稳定性都不好,尤其是用过一阵了的,用缺
省的512吧,另外盘子坏得太厉害的话,就只能skip几个sector了,谁叫自
己没早动手呢:),我现在都是盘子买来了新的赶紧dd出来先,用过几次了
就不一定还能这么容易了

iso
S*A
发帖数: 7142
17
From mkfs.xfs man page:
XFS on Linux currently only supports pagesize or smaller blocks.
(共0页)