linuxer
    @bear20081015:的确,不论是A32还是A64指令集,每个汇编指令都是32bit的,因此,instruction cache中的data信息应该就是32个bit,不过,spec中定义获取了两个20bit的data,共计40个bit,其实上面的回答我也是猜测的,可能又8个bit的控制状态信息,我也没有找到那多余8个bit的定义。
    计算机科学基础知识(一):The Memory Hierarchy  发表时间:2015-06-18 00:28
    bear20081015
    @linuxer:谢谢linux!第一个问题我没有疑问了,应该就是你说的那样。第二个问题你提到“虽然指令是32个bit,但是instruction cacheline中的数据并不是只有指令,还有其他的控制数据,因此需要两个寄存器。 ”,这样解释确实比较合理。但这样的话就意味着每个指令实际上还有额外的8个bit来指示其状态,这些bit是作为控制数据存储在entry中的?另外,不知道你有没有找到文档来解释这两个寄存器是如何combine成一个指令的,以及这8个控制bit的含义?多谢!
    计算机科学基础知识(一):The Memory Hierarchy  发表时间:2015-06-17 11:06
    amberhai
    致敬 wowo,很少有做技术还会思考这么多的。学习了。加油wowo
    关于蜗窝  发表时间:2015-06-17 09:47
    tigger
    @linuxer:因为会出现一种情况,几个core都在等同一把锁。这个时候就要知道哪个core拿锁。是不是core出现了问题,没有释放
    Linux内核同步机制之(四):spin lock  发表时间:2015-06-16 18:16
    linuxer
    @bear20081015:我没有研究过ARMV8的cache,不过既然你问了这个问题,我就花了一点时间看了看,我的想法是这样的: 1、ARM Cortex A53的物理地址空间是1TB,也就是说物理地址有40个bit 2、cache的机制采用Physically Indexed Physically Tagged (PIPT) 3、对于64KB的cache,其物理地址的组成是:0~5bit是cacheline offset(共计6个bit),6~14是set index(共计9个bit),15~39bit是tag(共计25个bit)。 4、对于8KB的cache,其物理地址的组成是:0~5bit是cacheline offset(共计6个bit),6~11是set index(共计6个bit),12~39bit是tag(共计28个bit)。 5、ARM Cortex A53的的L1 cache size可能的情况包括:8KB, 16KB, 32KB, or 64KB 作为编成接口,当然要cover所有的情况,因此tag address是28个bit(对应cache size是8KB的情况)。 虽然指令是32个bit,但是instruction cacheline中的数据并不是只有指令,还有其他的控制数据,因此需要两个寄存器。 我对ARMV8不熟悉,可能理解有误,仅供参考。
    计算机科学基础知识(一):The Memory Hierarchy  发表时间:2015-06-16 11:20
    linuxer
    @tigger:仅有owner跟next的情况下应该是无法知道持有锁的是哪一个core。不过你为何要知道哪一个core持有锁呢?具体的应用场景是什么?
    Linux内核同步机制之(四):spin lock  发表时间:2015-06-15 22:46
    bear20081015
    @tigger:我理解应该没办法知道。除非恰好这个spinlock是全局变量,然后可以通过system.map知道lock的名字。再看看code看能不能知道是哪段code拿到的。局部变量只能打开debug宏了。
    Linux内核同步机制之(四):spin lock  发表时间:2015-06-15 21:02
    bear20081015
    请问@wowo和@linuxer有没有研究过ARMV8里面的指令cache?我们最近碰到的一个问题要dump出指令cache的内容,但感觉spec上面的描述没怎么看明白(DDI0500F: ARM Cortex A53 Technical Reference Manual (TRM), r0p4 6.7.2节)。 P326页提到:The L1 Instruction memory system has the following key features: • Instruction side cache line length of 64 bytes. • 2-way set associative L1 Instruction cache. • 128-bit read interface to the L2 memory system. 也就说,cacheline的大小是64个字节,占6个bit;假设L1 instruction cache大小是64K的话,由于是2个way,那么用于set选择的bit应该是9个bit。所以留给TAG的bit也就是39-(6+9)=24个bit。但为什么在P340页描述的instruction cache line中tag的格式中, TAG address是28个bit呢? Bits Description [31] Unused. [30:29] Valid and set mode: 0b00 A32. 0b01 T32. 0b10 A64. 0b11 Invalid. [28] Non-secure state (NS). [27:0] Tag address. 更疑惑的一点是:在P340页提到“The CP15 Instruction Cache Data Read Operation returns two entries from the cache in Data Register 0 and Data Register 1 corresponding to the 16-bit al igned offset in the cache line: Data Register 0 Bits[19:0] data from cache offset+ 0b00. Data Register 1 Bits[19:0] data from cache offset+ 0b10. In A32 or A64 state these tw o fields combined always represent a single pre-decoded instruction.” 一条指令是32个bit,不是直接用一个寄存器就能返回去所有的data么?为什么要用到寄存器0和1呢?谢谢!
    计算机科学基础知识(一):The Memory Hierarchy  发表时间:2015-06-15 20:58
    tigger
    如果我只知道,arch_spinlock_t里面的owner跟next,我有方法知道是那个进程拿到了锁么??或者说哪个core。我想到有一种情况 比如我现在有8个core,core 1到core7 都在等同一把锁。owner 跟 next相差7,说明有7个thread在等,根据spinlock的原理,那么肯定是那个不再等的core上面拿了锁。 但是我又如何证明锁是被哪个core拿了呢? 再仅有owner跟next的情况下,是不是没法确定,必须打开debug的宏才知道呢?
    Linux内核同步机制之(四):spin lock  发表时间:2015-06-15 13:39
    wowo
    @qq2shui:阅读的话,用一个RSS订阅器应该就可以搞定。不过用手机看着应该很吃力吧~~ 打赏按钮?您是指money吗?这个蜗窝暂时不能弄啊,我们的文章,第一目标是把自己写明白,在这个目标实现之前,哪里好意思让向大家伸手啊。再说,关系到钱的话,安全性需要好好论证,以蜗窝们业余的精力,怕hold不住啊。 不过还是多谢qq2shui的建议,希望能有精力让蜗窝做的更好~~
    关于蜗窝  发表时间:2015-06-15 12:21

共7862条613/787上一页 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 下一页
Copyright @ 2013-2015 蜗窝科技 All rights reserved. Powered by emlog