Readit News logoReadit News
Tobu commented on Resistance to Rust abstractions for DMA mapping   lwn.net/SubscriberLink/10... · Posted by u/mustache_kimono
meltyness · 7 months ago

  The caller takes ownership of the returned resources, i.e., will have the responsibility in calling `bindings::dma_free_attrs`.
Hm, doesn't this violate RAII? Does this need to be public?

Tobu · 7 months ago
The method is called `CoherentAllocation::into_parts`. And it takes self by value, which means the struct is consumed (this is implied by the into_ prefix). Of course you would either reconstruct the allocation or free the allocation yourself after this.

See Vec::into_raw_parts or Box::into_raw for an stdlib analogy.

Tobu commented on CDC data are disappearing   theatlantic.com/health/ar... · Posted by u/doener
nimbius · 7 months ago
If you look back at Germany in the 19th century, nations like Prussia and Austria had this sort of power struggle between the merchant class and the nobility at the advent of steam power.

in this case the de-facto US nobility (rank-and-file career politicians) are being usurped by the bourgeouise (billionaires like Musk) at the advent of AI and tech by promising the working class a combination of culture war policy and relief from the very capitalist excess they themselves endorse. by reducing congress and senate to a simple debate team (conversely similar to the German National Asssembly) the tech-elite are able to seize power once reserved for the crown.

the question will be, after four years, will they abdicate their power or concentrate it?

Tobu · 7 months ago
> will they abdicate their power

Yeah, no. This is a coup and they are all in. They would not be this blatant about taking control illegally and fast if they expected to leave any institutions to still enforce the law against them.

Tobu commented on Improving Steam Client Stability on Linux   ttimo.typepad.com/blog/20... · Posted by u/Venn1
johannes1234321 · 10 months ago
PATH is a good example why steam does this: Steam is a program to launch a wide variety of other programs, which it doesn't fully control. Those programs (games) may do anything including launching further programs (utilities), so steam may set PATH so that the game finds those utilities.

It can also be a way to pass license information or other configuration settings.

Tobu · 10 months ago
Looks like the Steam team moved to control spawning and do execvpe.

I would like to see at least in-process environment modification discouraged. Rust is dealing with the issue by considering getenv unsafe when coming through C, but getting rid of the read side is much harder than the write side.

Tobu commented on Improving Steam Client Stability on Linux   ttimo.typepad.com/blog/20... · Posted by u/Venn1
WhyNotHugo · 10 months ago
I'm really curious why they're using setenv(3) so much. The main usages that I can think of is setting an environment variable before calling something like exec(3). That doesn't seem to be the case here.

The article mentions that they use exevpe for spawning children processes. So what usages of setenv(3) would remain?

Tobu · 10 months ago
It is possible to check for setenv/unsetenv/putenv with nm -D, and a quick sample of my ~/.cargo/bin/* shows far too many programs using those. Yeah they could be single threaded, but who can guarantee they will remain so? Come to think of it listing symbols could detect pthread_create as well.

I'd be interested in a way to do static binary analysis to get from those symbols to a call tree, as well.

I don't see a way to check for **environ usage though, the compiler could turn this one into anything.

Tobu commented on AAA Gaming on Asahi Linux   rosenzweig.io/blog/aaa-ga... · Posted by u/6a74
macrolime · a year ago
Does this mean we're closer to getting GPU support on Docker on Apple devices?
Tobu · a year ago
Tobu commented on USPS' long-awaited new mail truck makes its debut to rave reviews from carriers   apnews.com/article/postal... · Posted by u/achristmascarl
russfink · a year ago
DeJoy was a Trump appointee. As witnessed by other such appointees (education, EPA), I was concerned DeJoy would gut the postal service. Sounds like that isn’t the case.
Tobu · a year ago
There was indeed sabotage, in the form of dismantling and not replacing hundreds of working mail sorting machines in an election year: https://www.forbes.com/sites/andrewsolender/2020/08/19/repor...https://truthout.org/articles/usps-sorting-machines-are-stil...https://www.ajc.com/news/postal-service-tells-judge-mail-sor...https://edition.cnn.com/2020/09/09/politics/usps-removed-711...

I don't know how he hasn't been removed after this.

Tobu commented on Bcachefs, an Introduction/Exploration   blog.asleson.org/2024/07/... · Posted by u/marbu
jcalvinowens · a year ago
The idea that a brand new filesystem might be more reliable than good 'ol BTRFS, which Facebook runs on basically their entire infrastructure, is downright laughable to me.

Btrfs is also far more reliable than ZFS in my view, because it has far far more real world testing, and is also much more actively developed.

Magical perfect elegant code isn't what makes a good filesystem: real world testing, iteration, and bugfixing is. BTRFS has more of that right now than anything else ever has.

Tobu · a year ago
I've had my own bad experiences with Btrfs (it doesn't behave well when close to full), and my intuition is that Facebook's use of it is in a limited operational domain. It works well for their use case (uploaded media I think?), combined with the way they manage and provision clusters. Letting random users loose on it uncovers a variety of failure modes and fixes are slow to come.

On the other hand, while I haven't used it for /, dipping my toes in bcachefs with recoverable data has been a pleasant experience. Compression, encryption, checksumming, deduplication, easy filesystem resizing, SSD acceleration, ease of adding devices… it's good to have it all in one place.

Tobu commented on Bcachefs, an Introduction/Exploration   blog.asleson.org/2024/07/... · Posted by u/marbu
BlackLotus89 · a year ago
btrfs has deduplication as well.

In theory full file deduplication exists in every filesystem that has cow/reflink support

Tobu · a year ago
fclones for example covers it well for any filesystem with reflinks:

https://lib.rs/crates/fclones

fclones group |fclones dedupe

Tobu commented on Bcachefs, an Introduction/Exploration   blog.asleson.org/2024/07/... · Posted by u/marbu
Tobu · a year ago
> Error handling on CRC read error > 2 or more copies of file, CRC on error, read other copy, data returned to userspace, does not correct bad copy

That's been implemented; in Linux 6.11 bcachefs will correct errors on read. See

> - Self healing on read IO/checksum error

in https://lore.kernel.org/linux-bcachefs/73rweeabpoypzqwyxa7hl...

Making it possible to scrub from userspace by walking and reading everything (tar -c /mnt/bcachefs >/dev/null).

Tobu commented on Jiff: Datetime library for Rust   github.com/BurntSushi/jif... · Posted by u/goranmoomin
burntsushi · a year ago
The components are stored separately. I think what you are advocating for is component wise addition, which I mentioned in my previous comment. It can totally "work," but as I said, it will produce different results than `span1.checked_add(span2)`. For example:

    use jiff::{ToSpan, Unit, Zoned};

    fn main() -> anyhow::Result<()> {
        let span1 = 1.year().months(3);
        let span2 = 11.months();
        let now = Zoned::now().round(Unit::Minute)?;
        let added = span1.checked_add((span2, &now))?;
        println!("{added}");

        Ok(())
    }
Has this output:

    $ cargo -q r
    P2y2m
Notice how the months overflow automatically into years. Days will do the same into months. You need a reference point to do this correctly. For example, just `span1.checked_add(span2)?` would produce an error.

In contrast, component wise addition would lead to a span of `1 year 14 months`. Which is a valid `Span`. Jiff is fine with it. But it's different than what `checked_add` does. Having both operations seems too subtle.

Also, I don't really think using the `+` operator just to construct spans is that much of a win over what Jiff already has. So that needs to be taken into account as well.

Tobu · a year ago
The Into<SpanArithmetic> argument feels a little too magical. Since you are not constrained by a trait, I would prefer something like

    Span::add_with_reference(&self, other: &Span, reference: impl Into<SpanRelativeTo>)

u/Tobu

KarmaCake day1120June 7, 2009View Original