2 ms·
> Why we need a dedicated CPU and DRAM attached to flash memory. You can garbage collect and wear level in your OS if you want to. The thing I don't get is, th
by AnthonyMouse 3y ago
> Why we need a dedicated CPU and DRAM attached to flash memory. You can garbage collect and wear level in your OS if you want to.
The thing I don't get is, the chips are all commodities, and it's not like soldering them to a board is rocket science. Why isn't one of the companies that makes fully-specified inexpensive RISC-V chips selling one attached to some commodity flash chips and an NVMe connector? Include some minimalist open source firmware that offloads most of the work to the host OS and let the Linux community figure out how to make it better.
At minimum it should allow you to undercut the existing competition on price because you're using a less expensive controller and no DRAM, and in a few years the open source drivers could have enough advantages over black box devices that nobody wants to buy anything else.
- dezgeg 3y agoFor starters, I doubt that acting as a NVMe device is something you can do with a off the self "inexpensive RISC-V" with any kind of acceptable performance. A NVME engine would almost certainly be something that the flash controller would have implemented in fixed function hardware. Also NAND flash practically requires some sort of error correction system - another thing that fixed function logic in a custom ASIC is very well suited for. Using CPU time on the host CPU for that would probably suck.
- AnthonyMouse 3y agoThe basic function of transferring data between the flash chips and the PCIe bus shouldn't be a bottleneck. Dedicated silicon for error correction might be more efficient, but when there are already fast idle CPU cores it may not matter, and ECC algorithms can already be accelerated by SIMD instructions. Or for high performance machines add the dedicated silicon to the host CPU.
- dezgeg 3y agoThese kind of high speed interfaces aren't just something that one just bitbangs on some microcontroller. I think even the first step, ie. finding a RISC-V chip that has capability of acting as a PCIe device at all will be a challenge. "Inexpensive" for sure not.
- AnthonyMouse 3y agoThere are RISC-V chips with PCIe controllers on them. I'm not sure if you can use the hardware designed to act as a host to act as a device, but it wouldn't surprise me. In any case I would find it hard to believe that the hardware that can act as a device would cost significantly more. You can get a whole NVMe SSD for $15: https://www.newegg.com/silicon-power-128gb-p34a60/p/N82E16820301475?Item=N82E16820301475 https://www.newegg.com/silicon-power-128gb-p34a60/p/N82E1682... The hardware required to do this can't be that expensive.
- dezgeg 3y ago> I'm not sure if you can use the hardware designed to act as a host to act as a device, but it wouldn't surprise me. I don't how it is for PCIe, but for example USB is very asymmetric and host controllers generally cannot as devices. There do exist dual-mode IP cores (e.g. for mobile SoCs) > In any case I would find it hard to believe that the hardware that can act as a device would cost significantly more. Indeed the area/cost difference between host-only and dual mode controller may be small. But in a general purpose chip there will be dozens of other competiting features in all the other subsystems besides PCIe. Each of those small features would increase the chip cost, so they won't be added without a cost-benefit calculation. So it can still be that while PCIe device support would be cheap to add, it could still be considered too low bang-for-buck to be worth including. Or that there may be such chips supporting PCIe device mode, but they then also would include things like video encoding/decoding, HDMI, ethernet, etc. and thus be an expensive chip. > The hardware required to do this can't be that expensive. With a custom ASIC (the linked one seems to have Phison E12) that includes only the minimal needed hardware, yes.
- snvzz 3y ago>RISC-V in charge of NAND storage, presenting NVMe (or SATA) interface. Aren't WD SSDs just that?
- dezgeg 3y agoNo, they are not just a converter that exposes raw NAND to your PC. Rather they abstract away all the details of how painful raw NAND is to deal with into simple "read/write sectors" interface that all your normal filesystems like ext4, NTFS, etc. deal with. Raw NAND comes with various pain-in-the-ass limitations such as: only erasable in huge (~megabytes) blocks at a time, only writable in slightly-uncomfortably-big chunks (like 32KB or so), and erasing a given region can be done a limited amount of times before it breaks. Oh, and all those details (like exact sizes of erases and writes) will change time to time as manufacturing processes of NAND dies get more advanced.
- AnthonyMouse 3y agoThat's software, not hardware. And operating systems have long dealt with things like variable sector sizes. You want the abstraction layer. What you don't want is for it to be a black box, and what you shouldn't care about is whether the silicon that runs the code is soldered to the flash chips or not.
- rjsw 3y agoWhy offload it to the host? If the CPU on the NVMe card is well documented then run the flash software on that. The same goes for network offload features in ethernet controllers, make it an open architecture that you can write your own firmware for.
- AnthonyMouse 3y agoThe host CPU is faster, which lowers access latency, and modern machines have large numbers of generally idle cores. It also reduces the cost of the drive. Meanwhile you could also have drives with offload engines, in the same way that some network cards have offload engines and some don't. But the ones that do are more expensive.
- hedgehog 3y agoMy guess is because flash chips are quirky and not very interchangeable. The error correction, wear leveling, etc all probably needs to be configured and calibrated to the specific chips used in a way that only can really be done by the manufacturer or a really big OEM like Apple.
- AnthonyMouse 3y agoI'm trying to imagine why wear leveling would depend on the chips. The number of writes you can get out of them would, but the optimal wear leveling algorithm should be to spread the writes around as much as possible regardless of that, shouldn't it? Likewise, some chips could require more error correction because they expect more errors. But the amount of error correction is a tunable in the algorithm; it's a space vs. resilience trade off. Where to set the dial shouldn't be hard to derive from the manufacturer's specifications, or empirical testing if the spec is worthless.
- hedgehog 3y agoWear leveling: Just search Google Scholar for "wear leveling" to get an idea for how deep that rabbit hole goes. At minimum think about the difference between placing an infrequently written logical sector vs a frequently written one, and what the optimal strategy would be given physical blocks with varying write life left on them. Then how do you partition between regions you treat as SLC vs MLC? And on and on and on. Error correction: Not just amount. What block size? Interleaving? How do you trade overhead due to more ECC vs overhead due to more spare blocks (have to decide how many to allocate up front)? What is the behavior vs temperature and what are you running the thing at? There has been an ongoing push to standardize NAND interfaces but the controller still needs to know a fair amount about the specific chips it's talking to. I don't know how it will resolve but hopefully the integration becomes more like DRAM where things are a bit more consistent. Then again, if you care a lot about reliability you qualify specific DRAM modules too...
- AnthonyMouse 3y ago> At minimum think about the difference between placing an infrequently written logical sector vs a frequently written one, and what the optimal strategy would be given physical blocks with varying write life left on them. That's not a simple answer but why would it depend on whose chips you have? > What is the behavior vs temperature and what are you running the thing at? This is where you might start seeing differences between manufacturers. But this is also optimization. If you don't have this information the chip should still meet a minimum spec and you can use a conservative value. If you do know it you can do something more efficient. And if this becomes popular the chip makers will start publishing what's necessary to do the optimization.
- deleted 3y ago[deleted]