03 Feb 2025
planet.freedesktop.org
Christian Schaller: Looking ahead at 2025 and Fedora Workstation and jobs on offer!
So a we are a little bit into the new year I hope everybody had a great break and a good start of 2025. Personally I had a blast having gotten the kids an air hockey table as a Yuletide present :). Anyway, wanted to put this blog post together talking about what we are looking at for the new year and to let you all know that we are hiring.
Artificial Intelligence
One big item on our list for the year is looking at ways Fedora Workstation can make use of artificial intelligence. Thanks to IBMs Granite effort we know have an AI engine that is available under proper open source licensing terms and which can be extended for many different usecases. Also the IBM Granite team has an aggressive plan for releasing updated versions of Granite, incorporating new features of special interest to developers, like making Granite a great engine to power IDEs and similar tools. We been brainstorming various ideas in the team for how we can make use of AI to provide improved or new features to users of GNOME and Fedora Workstation. This includes making sure Fedora Workstation users have access to great tools like RamaLama, that we make sure setting up accelerated AI inside Toolbx is simple, that we offer a good Code Assistant based on Granite and that we come up with other cool integration points.
Wayland
The Wayland community had some challenges last year with frustrations boiling over a few times due to new protocol development taking a long time. Some of it was simply the challenge of finding enough people across multiple projects having the time to follow up and help review while other parts are genuine disagreements of what kind of things should be Wayland protocols or not. That said I think that problem has been somewhat resolved with a general understanding now that we have the 'ext' namespace for a reason, to allow people to have a space to review and make protocols without an expectation that they will be universally implemented. This allows for protocols of interest only to a subset of the community going into 'ext' and thus allowing protocols that might not be of interest to GNOME and KDE for instance to still have a place to live.
The other more practical problem is that of having people available to help review protocols or providing reference implementations. In a space like Wayland where you need multiple people from multiple different projects it can be hard at times to get enough people involved at any given time to move things forward, as different projects have different priorities and of course the developers involved might be busy elsewhere. One thing we have done to try to help out there is to set up a small internal team, lead by Jonas Ådahl, to discuss in-progress Wayland protocols and assign people the responsibility to follow up on those protocols we have an interest in. This has been helpful both as a way for us to develop internal consensus on the best way forward, but also I think our contribution upstream has become more efficient due to this.
All that said I also believe Wayland protocols will fade a bit into the background going forward. We are currently at the last stage of a community 'ramp up' on Wayland and thus there is a lot of focus on it, but once we are over that phase we will probably see what we saw with X.org extensions over time, that for the most time new extensions are so niche that 95% of the community don't pay attention or care. There will always be some new technology creating the need for important new protocols, but those are likely to come along a relatively slow cadence.
High Dynamic Range
As for concrete Wayland protocols the single biggest thing for us for a long while now has of course been the HDR support for Linux. And it was great to see the HDR protocol get merged just before the holidays. I also want to give a shout out to Xaver Hugl from the KWin project. As we where working to ramp up HDR support in both GNOME Shell and GTK+ we ended up working with Xaver and using Kwin for testing especially the GTK+ implementation. Xaver was very friendly and collaborative and I think HDR support in both GNOME and KDE is more solid thanks to that collaboration, so thank you Xaver!
Talking about concrete progress on HDR support Jonas Adahl submitted merge requests for HDR UI controls for GNOME Control Center. This means you will be able to configure the use of HDR on your system in the next Fedora Workstation release.
PipeWire
I been sharing a lot of cool PipeWire news here in the last couple of years, but things might slow down a little as we go forward just because all the major features are basically working well now. The PulseAudio support is working well and we get very few bug reports now against it. The reports we are getting from the pro-audio community is that PipeWire works just as well or better as JACK for most people in terms of for instance latency, and when we do see issues with pro-audio it tends to be more often caused by driver issues triggered by PipeWire trying to use the device in ways that JACK didn't. We been resolving those by adding more and more options to hardcode certain options in PipeWire, so that just as with JACK you can force PipeWire to not try things the driver has problems with. Of course fixing the drivers would be the best outcome, but for some of these pro-audio cards they are so niche that it is hard to find developers who wants to work on them or who has hardware to test with.
We are still maturing the video support although even that is getting very solid now. The screen capture support is considered fully mature, but the camera support is still a bit of a work in progress, partially because we are going to a generational change the camera landscape with UVC cameras being supplanted by MIPI cameras. Resolving that generational change isn't just on PipeWire of course, but it does make the a more volatile landscape to mature something in. Of course an advantage here is that applications using PipeWire can easily switch between V4L2 UVC cameras and libcamera MIPI cameras, thus helping users have a smooth experience through this transition period.
But even with the challenges posed by this we are moving rapidly forward with Firefox PipeWire camera support being on by default in Fedora now, Chrome coming along quickly and OBS Studio having PipeWire support for some time already. And last but not least SDL3 is now out with PipeWire camera support.
MIPI camera support
Hans de Goede and Kate Hsuan keeps working on making sure MIPI cameras work under Linux. MIPI cameras are a step forward in terms of technical capabilities, but at the moment a bit of a step backward in terms of open source as a lot of vendors believe they have 'secret sauce' in the MIPI camera stacks. Our works focuses mostly on getting the Intel MIPI stack fully working under Linux with the Lattice MIPI aggregator being the biggest hurdle currently for some laptops. Luckily Alan Stern, the USB kernel maintainer, is looking at this now as he got the hardware himself.
Flatpak
Some major improvements to the Flatpak stack has happened recently with the USB portal merged upstream. The USB portal came out of the Sovereign fund funding for GNOME and it gives us a more secure way to give sandboxed applications access to you USB devcices. In a somewhat related note we are still working on making system daemons installable through Flatpak, with the usecase being applications that has a system daemon to communicate with a specific piece of hardware for example (usually through USB). Christian Hergert got this on his todo list, but we are at the moment waiting for Lennart Poettering to merge some pre-requisite work into systemd that we want to base this on.
Accessibility
We are putting in a lot of effort towards accessibility these days. This includes working on portals and Wayland extensions to help facilitate accessibility, working on the ORCA screen reader and its dependencies to ensure it works great under Wayland. Working on GTK4 to ensure we got top notch accessibility support in the toolkit and more.
GNOME Software
Last year Milan Crha landed the support for signing the NVIDIA driver for use on secure boot. The main feature Milan he is looking at now is getting support for DNF5 into GNOME Software. Doing this will resolve one of the longest standing annoyances we had, which is that the dnf command line and GNOME Software would maintain two separate package caches. Once the DNF5 transition is done that should be a thing of the past and thus less risk of disk space being wasted on an extra set of cached packages.
Firefox
Martin Stransky and Jan Horak has been working hard at making Firefox ready for the future, with a lot of work going into making sure it supports the portals needed to function as a flatpak and by bringing HDR support to Firefox. In fact Martin just got his HDR patches for Firefox merged this week. So with the PipeWire camera support, Flatpak support and HDR support in place, Firefox will be ready for the future.
We are hiring! looking for 2 talented developers to join the Red Hat desktop team
We are hiring! So we got 2 job openings on the Red Hat desktop team! So if you are interested in joining us in pushing the boundaries of desktop linux forward please take a look and apply. For these 2 positions we are open to remote workers across the globe and while the job adds list specific seniorities we are somewhat flexible on that front too for the right candidate. So be sure to check out the two job listings and get your application in! If you ever wanted to work fulltime on GNOME and related technologies this is your chance.
03 Feb 2025 12:29pm GMT
20 Jan 2025
planet.freedesktop.org
André Almeida: Linux 6.13, I WANT A GUITAR PEDAL
Just as 2025 is starting, we got a new Linux release in mid January, tagged as 6.13. In the spirit of holidays, Linus Torvalds even announced during 6.13-rc6 that he would be building and raffling a guitar pedal for a random kernel developer!
As usual, this release comes with a pack of exciting news done by the kernel community:
-
This release has two important improvements for task scheduling: lazy preemption and proxy execution. The goal with lazy preemption is to find a better balance between throughput and response time. A secondary goal is being able to make it the preferred non-realtime scheduling policy for most cases. Tasks that really need a reschedule in a hurry will use the older
TIF_NEED_RESCHED
flag. A preliminary work for proxy execution was merged, which will let us avoid priority-inversion scenarios when using real time tasks with deadline scheduling, for use cases such as Android. -
New important Rust abstractions arrived, such as VFS data structures and interfaces, and also abstractions for misc devices.
-
Lightweight guard pages: guard pages are used to raise a fatal signal when accessed. This feature had the drawback of having a heavy performance impact, but in this new release the flag
MADV_GUARD_INSTALL
was added for themadvise()
syscall, offering a lightweight way to guard pages.
To know more about the community improvements, check out the summary made by Kernel Newbies.
Now let's highlight the contributions made by Igalians for this release.
Case-insensitive support for tmpfs
Case sensitivity has been a traditional difference between Linux distros and MS Windows, with the most popular filesystems been in opposite sides: while ext4 is case sensitive, NTFS is case insensitive. This difference proved to be challenging when Windows apps, mainly games, started to be a common use case for Linux distros (thanks to Wine!). For instance, games running through Steam's Proton would expect that the path assets/player.png
and assets/PLAYER.PNG
would point to be the same file, but this is not the case in ext4. To avoid doing workarounds in userspace, ext4 has support for casefolding since Linux 5.2.
Now, tmpfs joins the group of filesystems with case-insensitive support. This is particularly useful for running games inside containers, like the combination of Wine + Flatpak. In such scenarios, the container shares a subset of the host filesystem with the application, mounting it using tmpfs. To keep the filesystem consistent, with the same expectations of the host filesystem about the mounted one, if the host filesystem is case-insensitive we can do the same thing for the container filesystem too. You can read more about the use case in the patchset cover letter.
While the container frameworks implement proper support for this feature, you can play with it and try it yourself:
$ mount -t tmpfs -o casefold fs_name /mytmpfs
$ cd /mytmpfs # case-sensitive by default, we still need to enable it
$ mkdir a
$ touch a; touch A
$ ls
A a
$ mkdir B; cd b
cd: The directory 'b' does not exist
$ # now let's create a case-insensitive dir
$ mkdir case_dir
$ chattr +F case_dir
$ cd case_dir
$ touch a; touch A
$ ls
a
$ mkdir B; cd b
$ pwd
$ /home/user/mytmpfs/case_dir/B
V3D Super Pages support
As part of Igalia's effort for enhancing the graphics stack for Raspberry Pi, the V3D DRM driver now has support for Super Pages, improving performance and making memory usage more efficient for Raspberry Pi 4 and 5. Using Linux 6.13, the driver will enable the MMU to allocate not only the default 4KB pages, but also 64KB "Big Pages" and 1MB "Super Pages".
To measure the difference that Super Pages made to the performance, a series of benchmarks where used, and the highlights are:
- +8.36% of FPS boost for Warzone 2100 in RPi4
- +3.62% of FPS boost for Quake 2 in RPi5
- 10% time reduction for the Mesa CI job
v3dv-rpi5-vk-full:arm64
- Aether SX2 emulator is more fluid to play
You can read a detailed post about this, with all benchmark results, in Maíra's blog post, including a super cool PlayStation 2 emulation showcase!
New transparent_hugepage_shmem=
command-line parameter
Igalia contributed new kernel command-line parameters to improve the configuration of multi-size Transparent Huge Pages (mTHP) for shmem. These parameters, transparent_hugepage_shmem=
and thp_shmem=
, enable more flexible and fine-grained control over the allocation of huge pages when using shmem.
The transparent_hugepage_shmem=
parameter allows users to set a global default huge page allocation policy for the internal shmem mount. This is particularly valuable for DRM GPU drivers. Just as CPU architectures, GPUs can also take advantage of huge pages, but this is possible only if DRM GEM objects are backed by huge pages.
Since GEM uses shmem to allocate anonymous pageable memory, having control over the default huge page allocation policy allows for the exploration of huge pages use on GPUs that rely on GEM objects backed by shmem.
In addition, the thp_shmem=
parameter provides fine-grained control over the default huge page allocation policy for specific huge page sizes.
By configuring page sizes and policies of huge-page allocations for the internal shmem mount, these changes complement the V3D Super Pages feature, as we can now tailor the size of the huge pages to the needs of our GPUs.
DRM and AMDGPU improvements
As usual in Linux releases, this one collects a list of improvements made by our team in DRM and AMDGPU driver from the last cycle.
Cosmic (the desktop environment behind Pop! OS) users discovered some bugs in the AMD display driver regarding the handling of overlay planes. These issues were pre-existing and came to light with the introduction of cursor overlay mode. They were causing page faults and divide errors. We debugged the issue together with reporters and proposed a set of solutions that were ultimately accepted by AMD developers in time for this release.
In addition, we worked with AMD developers to migrate the driver-specific handling of EDID data to the DRM common code, using drm_edid opaque objects to avoid handling raw EDID data. The first phase was incorporated and allowed the inclusion of new functionality to get EDID from ACPI. However, some dependencies between the AMD the Linux-dependent and OS-agnostic components were left to be resolved in next iterations. It means that next steps will focus on removing the legacy way of handling this data.
Also in the AMD driver, we fixed one out of bounds memory write, fixed one warning on a boot regression and exposed special GPU memory pools via the fdinfo common DRM framework.
In the DRM scheduler code, we added some missing locking, removed a couple of re-lock cycles for slightly reduced command submission overheads and clarified the internal documentation.
In the common dma-fence code, we fixed one memory leak on the failure path and one significant runtime memory leak caused by incorrect merging of fences. The latter was found by the community and was manifesting itself as a system out of memory condition after a few hours of gameplay.
sched_ext
The sched_ext landed in kernel 6.12 to enable the efficient development of BPF-based custom schedulers. During the 6.13 development cycle, the sched_ext community has made efforts to harden the code to make it more reliable and clean up the BPF APIs and documentation for clarity.
Igalia has contributed to hardening the sched_ext core code. We fixed the incorrect use of the scheduler run queue lock, especially during initializing and finalizing the BPF scheduler. Also, we fixed the missing RCU lock protections when the sched_core selects a proper CPU for a task. Without these fixes, the sched_ext core, in the worst case, could crash or raise a kernel oops message.
Other Contributions & Fixes
syzkaller, a kernel fuzzer, has been an important instrument to find kernel bugs. With the help of KASAN, a memory error detector, and syzbot, numerous such bugs have been reported and fixed.
Igalians have contributed to such fixes around a lot of subsystems (like media, network, etc), helping reduce the number of open bugs.
Check the complete list of Igalia's contributions for the 6.13 release
Authored (70)
André Almeida
- unicode: Fix utf8_load() error path
- MAINTAINERS: Add Unicode tree
- scripts/kernel-doc: Fix build time warnings
- libfs: Create the helper function generic_ci_validate_strict_name()
- ext4: Use generic_ci_validate_strict_name helper
- unicode: Export latest available UTF-8 version number
- unicode: Recreate utf8_parse_version()
- libfs: Export generic_ci_ dentry functions
- tmpfs: Add casefold lookup support
- tmpfs: Add flag FS_CASEFOLD_FL support for tmpfs dirs
- tmpfs: Expose filesystem features via sysfs
- docs: tmpfs: Add casefold options
- libfs: Fix kernel-doc warning in generic_ci_validate_strict_name
- tmpfs: Fix type for sysfs' casefold attribute
- tmpfs: Initialize sysfs during tmpfs init
Changwoo Min
- sched_ext: Replace rq_lock() to raw_spin_rq_lock() in scx_ops_bypass()
- sched_ext: Clarify sched_ext_ops table for userland scheduler
- sched_ext: add a missing rcu_read_lock/unlock pair at scx_select_cpu_dfl()
- MAINTAINERS: add me as reviewer for sched_ext
Christian Gmeiner
Guilherme G. Piccoli
- Documentation: Improve crash_kexec_post_notifiers description
- wifi: rtlwifi: Drastically reduce the attempts to read efuse in case of failures
Maíra Canal
- drm/v3d: Address race-condition in MMU flush
- drm/v3d: Flush the MMU before we supply more memory to the binner
- drm/v3d: Fix return if scheduler initialization fails
- drm/gem: Create a drm_gem_object_init_with_mnt() function
- drm/v3d: Introduce gemfs
- drm/gem: Create shmem GEM object in a given mountpoint
- drm/v3d: Reduce the alignment of the node allocation
- drm/v3d: Support Big/Super Pages when writing out PTEs
- drm/v3d: Use gemfs/THP in BO creation if available
- drm/v3d: Add modparam for turning off Big/Super Pages
- drm/v3d: Expose Super Pages capability
- drm/vc4: Use
vc4_perfmon_find()
- MAINTAINERS: Add Maíra to VC4 reviewers
- mm: shmem: control THP support through the kernel command line
- mm: move
get_order_from_str()
to internal.h - mm: shmem: override mTHP shmem default with a kernel parameter
- mm: huge_memory: use strscpy() instead of strcpy()
- drm/v3d: Enable Performance Counters before clearing them
- drm/v3d: Ensure job pointer is set to NULL after job completion
Melissa Wen
- drm/amd/display: switch amdgpu_dm_connector to use struct drm_edid
- drm/amd/display: switch to setting physical address directly
- drm/amd/display: always call connector_update when parsing freesync_caps
- drm/amd/display: remove redundant freesync parser for DP
- drm/amd/display: add missing tracepoint event in DM atomic_commit_tail
- drm/amd/display: fix page fault due to max surface definition mismatch
- drm/amd/display: increase MAX_SURFACES to the value supported by hw
- drm/amd/display: fix divide error in DM plane scale calcs
Thadeu Lima de Souza Cascardo
- media: uvcvideo: Require entities to have a non-zero unique ID
- hfsplus: don't query the device logical block size multiple times
- Bluetooth: btmtk: avoid UAF in btmtk_process_coredump
Tvrtko Ursulin
- drm/v3d: Appease lockdep while updating GPU stats
- drm/sched: Add locking to drm_sched_entity_modify_sched
- Documentation/gpu: Document the situation with unqualified drm-memory-
- drm/amdgpu: Drop unused fence argument from amdgpu_vmid_grab_used
- drm/amdgpu: Use drm_print_memory_stats helper from fdinfo
- drm/amdgpu: Drop impossible condition from amdgpu_job_prepare_job
- drm/amdgpu: Remove the while loop from amdgpu_job_prepare_job
- drm/sched: Optimise drm_sched_entity_push_job
- drm/sched: Stop setting current entity in FIFO mode
- drm/sched: Re-order struct drm_sched_rq members for clarity
- drm/sched: Re-group and rename the entity run-queue lock
- drm/sched: Further optimise drm_sched_entity_push_job
- drm/amd/pm: Vangogh: Fix kernel memory out of bounds write
- drm/amdgpu: Stop reporting special chip memory pools as CPU memory in fdinfo
- drm/amdgpu: Expose special on chip memory pools in fdinfo
- dma-fence: Fix reference leak on fence merge failure path
- dma-fence: Use kernel's sort for merging fences
- workqueue: Do not warn when cancelling WQ_MEM_RECLAIM work from !WQ_MEM_RECLAIM worker
Reviewed (41)
André Almeida
- futex: Use atomic64_inc_return() in get_inode_sequence_number()
- futex: Use atomic64_try_cmpxchg_relaxed() in get_inode_sequence_number()
- mm: shmem: use signed int for version handling in casefold option
Christian Gmeiner
- drm/vc4: Use
vc4_perfmon_find()
- drm/etnaviv: Request pages from DMA32 zone on addressing_limited
- drm/etnaviv: Use unsigned type to count the number of pages
- drm/etnaviv: Use 'unsigned' type to count the number of pages
- drm/etnaviv: Drop the <linux/pm_runtime.h> header
- drm/etnaviv: Fix missing mutex_destroy()
- drm/etnaviv: hold GPU lock across perfmon sampling
- drm/etnaviv: assert GPU lock held in perfmon pipe_*_read functions
- drm/etnaviv: unconditionally enable debug registers
- drm/etnaviv: update hardware headers from rnndb
- drm/etnaviv: take current primitive into account when checking for hung GPU
- drm/etnaviv: always allocate 4K for kernel ringbuffers
- drm/etnaviv: flush shader L1 cache after user commandstream
Iago Toral Quiroga
- drm/v3d: Address race-condition in MMU flush
- drm/v3d: Flush the MMU before we supply more memory to the binner
- drm/v3d: Fix return if scheduler initialization fails
- drm/v3d: Introduce gemfs
- drm/v3d: Reduce the alignment of the node allocation
- drm/v3d: Expose Super Pages capability
- drm/v3d: Enable Performance Counters before clearing them
Jose Maria Casanova Crespo
Juan A. Suarez
Maíra Canal
- drm/v3d: Use v3d_perfmon_find()
- drm/vc4: Run default client setup for all variants.
- drm/vc4: Match drm_dev_enter and exit calls in vc4_hvs_lut_load
- drm/vc4: Match drm_dev_enter and exit calls in vc4_hvs_atomic_flush
- drm/vc4: Correct generation check in vc4_hvs_lut_load
- drm/vkms: Drop unnecessary call to drm_crtc_cleanup()
Tvrtko Ursulin
- drm/gem: Create a drm_gem_object_init_with_mnt() function
- drm/gem: Create shmem GEM object in a given mountpoint
- drm/v3d: Support Big/Super Pages when writing out PTEs
- drm/v3d: Use gemfs/THP in BO creation if available
- drm/v3d: Add modparam for turning off Big/Super Pages
- drm: add DRM_SET_CLIENT_NAME ioctl
- drm: use drm_file client_name in fdinfo
- drm/amdgpu: make drm-memory-* report resident memory
- dma-buf: fix dma_fence_array_signaled v4
- dma-buf: Fix __dma_buf_debugfs_list_del argument for !CONFIG_DEBUG_FS
Tested (1)
Christian Gmeiner
Acked (5)
Changwoo Min
- sched_ext: Rename
scx_bpf_dispatch[_vtime]()
toscx_bpf_dsq_insert[_vtime]()
- sched_ext: Rename
scx_bpf_consume()
toscx_bpf_dsq_move_to_local()
- sched_ext: Rename
scx_bpf_dispatch[_vtime]_from_dsq*()
->scx_bpf_dsq_move[_vtime]*()
Maíra Canal
Maintainer SoB (6)
Maíra Canal
- MAINTAINERS: remove myself as a VKMS maintainer
- MAINTAINERS: Add myself as VKMS Maintainer
- drm/vkms: Add documentation
- drm/vkms: Suppress context imbalance detected by sparse warning
- drm/vkms: Add missing check for CRTC initialization
- drm/v3d: Drop allocation of object without mountpoint
20 Jan 2025 12:00am GMT
18 Jan 2025
planet.freedesktop.org
Simon Ser: Status update, January 2025
Hi all!
FOSDEM is approaching rapidly! I'll be there and will give a talk about modern IRC.
In wlroots land, we've finally merged support for the next-generation screen capture protocols, ext-image-capture-source-v1 and ext-image-copy-capture-v1! Compared to the previous wlroots-specific protocol, the new one provides better damage tracking, enables cursor capture (useful for remote desktop apps) and per-window capture (this part is not yet implemented in wlroots). Thanks to Kirill Primak, wlroots now supports the xdg-toplevel-icon-v1 protocol, useful for clients which want to update their window icon without changing their application ID (either by providing an icon name or pixel buffers). Kirill also added safety assertions everywhere in wlroots to ensure that all listeners are properly removed when a struct is destroyed.
I've revived some old patches to better identify outputs in wlroots and libdisplay-info. Currently, there are two common ways to refer to an output: either by its name (e.g. "DP-2"), or by its make+model+serial (e.g. "Foo Corp C4FE 42424242"). Unfortunately, both of these naming schemes have downsides. The name is ill-suited to configuration files because it's unstable and might change on reboot or unplug (it depends on driver load order, and DP-MST connectors get a new name each time they are re-plugged). The make+model+serial uses a database to look up the human-readable manufacturer name (so database updates break config files), and is not unique enough (different models might share a duplicate string). A new wlr_output.port
field and a libdisplay-info device tag should address these shortcomings.
Jacob McNamee has contributed a Sway patch to add security context properties to IPC, criteria and title format. With this patch, scripts can now figure out whether an application is sandboxed, and a special title can be set for sandboxed (or unsandboxed) apps. There are probably more use-cases we didn't think of!
I've managed to put aside some time to start reviewing the DRM color pipeline patches. As discussed in the last XDC it's in a pretty good shape so I've started dropping some Reviewed-by
tags. While discussing with David Turner about libliftoff, I've realized that the DRM_MODE_PAGE_FLIP_EVENT
flag was missing some documentation (it's not obvious how it interacts with the atomic uAPI) so I've sent a patch to fix that.
I continue pushing small updates to go-imap, bringing it little by little closer to version 2.0. I've added helpers to make it easier for servers to implement the FETCH
command, implemented FETCH BINARY
and header field decoding for SEARCH
in the built-in in-memory server, added limits for the IMAP command size to prevent denial-of-service, and fixed a few bugs. While testing with ImapTest, I've discovered and fixed a bug in Go's mime/quotedprintable
package.
Thanks to pounce, goguma now internally keeps track of message reactions. This is not used just yet, but will be soon once we add a user interface to display and send reactions. Support for deleting messages (called "redact" in the spec) has been merged. I've also implemented a small date indicator which shows up when scrolling in a conversation.
That's all for this month, see you at FOSDEM!
18 Jan 2025 10:00pm GMT
16 Jan 2025
planet.freedesktop.org
Christian Gmeiner: Multiple Render Targets for etnaviv
Modern graphics programming revolves around achieving high-performance rendering and visually stunning effects. Among OpenGL's capabilities, Multiple Render Targets (MRTs) are particularly valuable for enabling advanced rendering techniques with greater efficiency. With the latest release of Mesa 24.03 and the commitment from Igalia, the etnaviv GPU driver now includes support for MRTs. If you've ever wondered how MRTs can transform your graphics pipeline or are curious about the challenges of implementing this feature, this blog post is for you.
16 Jan 2025 12:00am GMT
14 Jan 2025
planet.freedesktop.org
Hans de Goede: IPU6 camera support status update
The initial IPU6 camera support landed in Fedora 41 only works on a limited set of laptops. The reason for this is that with MIPI cameras every different sensor and glue-chip like IO-expanders needs to be supported separately.
I have been working on making the camera work on more laptop models. After receiving and sending many emails and blog post comments about this I have started filing Fedora bugzilla issues on a per sensor and/or laptop-model basis to be able to properly keep track of all the work.
Currently the following issues are being either actively being worked on, or are being tracked to be fixed in the future.
Issues which have fixes pending (review) upstream:
- IPU6 camera on TERRA PAD 1262 V2 not working, fix has been accepted upstream.
- IPU6 camera on Dell XPS 9x40 models with ov02c10 sensor not working, sensor driver has been submitted upstream.
Open issues with various states of progress:
- IPU6 camera on Dell Latitude 7450 laptop not working
- IPU6 camera on HP Spectre x360 14-eu0xxx / Spectre 16 MeteorLake with ov08x40 not working
- IPU6 camera on HP Spectre x360 2-in-1 16-f1xxx/891D with hi556 sensor not working
- IPU6 camera on Lenovo ThinkPad X1 Carbon Gen 12 not working
- Lattice MIPI Aggregator support for IPU6 cameras
- Lunar Lake MIPI camera / IPU7 CSI receiver support
- ov01a10 camera sensor driver lacks 1296x816 mode support
- No driver for ov01a1s camera sensor
- iVSC fails to probe with ETIMEDOUT
- iVSC fails to probe with EINVAL on XPS 9315
See all the individual bugs for more details. I plan to post semi-regular status updates on this on my blog.
This above list of issues can also be found on my Fedora 42 change proposal tracking this and I intent to keep an updated complete list of all x86 MIPI camera issues (including closed ones) there.
comments
14 Jan 2025 2:21pm GMT
09 Jan 2025
planet.freedesktop.org
Mike Blumenkrantz: Rake In Bike
First Perf of the Year
I got a ticket last year about this game Everspace having bad perf on zink. I looked at it a little then, but it was the end of the year and I was busy doing other stuff. More important stuff. I definitely wasn't just procrastinating.
In any case, I didn't fix it last year, so I dusted it off the other day and got down to business. Unsurprisingly, it was still slow.
Easing Into Speed
The first step is always a flamegraph, and as expected, I got a hit:
Huge bottlenecking when checking query results, specifically in semaphore waits. What's going on here?
What's going on is this game is blocking on timestamp queries, and the overhead of doing vkWaitSemaphores(t=0)
to check drm syncobj progress for the result is colossal. Who could have guessed that using core Vulkan mechanics in a hotpath would obliterate perf?
Fixing this is very stupid: directly checking query results with vkGetQueryPoolResults
avoids syncobj access inside drivers by accessing what are effectively userspace fences, which Vulkan doesn't directly permit. If an app starts polling on query results, zink now uses this rather than its usual internal QBO mechanism.
Bottleneck uncorked and performance fixed. Right?
Naaaaaa
The perf is still pretty bad. It's time to check in with the doctor. Looking through some of the renderpasses reveals all kinds of begin/end tomfoolery. Paring this down, renderpasses are being split for layout changes to toggle feedback loops:
The game is rendering to one miplevel of a framebuffer attachment while sampling from another miplevel of the same image. This breaks zink's heuristic for detecting implicit feedback loops. Improvements here tighten up that detection to flatten out the renderpasses.
Gottagofastium
Perf recovered: the game runs roughly 150% faster, putting it on par with RadeonSI. Maybe some other games will be affected? Who can say.
09 Jan 2025 12:00am GMT
07 Jan 2025
planet.freedesktop.org
Mike Blumenkrantz: Manifested
I'm not saying we're doing it
Don't quote me. We're not doing it.
Unless we are, in which case everything I wrote last year may come to pass with the advent of the unified OpenGL/ES '25 release. This is not a release announcement, but I'm tentatively planning to provide the date of the announcement once the ray-tracing EXT goes live.
Confused? Well, you better figure it out quick cuz this is only the first week of 2025 and we got 51 more to go.
In the meanwhile, get in the car: we're going mesh shading.
DISCLAIMER
I gotta do this every year because we can't have fun anymore on the internet. C'mon. Obviously there's no ray-tracing EXT in the pipe BECAUSE WE'RE GOING MESH SHAAADIIIIIIIIIIIIIIIIIIII
07 Jan 2025 12:00am GMT
20 Dec 2024
planet.freedesktop.org
Lucas Fryzek: 2024 Graphics Team Contributions at Igalia
2024 has been an exciting year for the Igalia's Graphics Team. We've been making a lot of progress on Turnip, AMD display driver, the Raspberry Pi graphics stack, Vulkan video, and more.
Vulkan Device Generated Commands
Igalia's Ricardo Garcia has been working hard on adding support for the new VK_EXT_device_generated_commands
extension in the Vulkan Conformance Test Suite. He wrote an excellent blog post on the extension and on his work that you can read here. Ricardo also presented the extension at XDC 2024 in Montréal, which he also blogged about. Take a look and see what generating Vulkan commands directly on the GPU looks like!
Raspberry Pi Enhancements & Performance Improvements
Our very own Maíra Canal made a big contribution to improve the graphics performance of Raspberry Pi 4 & 5 devices by introducing support for "Super Pages". She wrote an excellent and detailed blog post on what Super Pages are, how they improve performance, and comparing performance of different apps and games. You can read all the juicy details here.
She also worked on introducing CPU jobs to the Broadcom GPU kernel driver in Linux. These changes allow user space to implement jobs that get executed on the CPU in sync with the work on the GPU. She wrote a great blog post detailing what CPU jobs allow you to do and how they work that you can read here.
Christian Gmeiner on the Graphics team has also been working on adding Perfetto support to Broadcom GPUs. Perfetto is a performance tracing tool and support for it in Broadcom drivers will allow to developers to gain more insight into bottlenecks of their GPU applications. You can check out his changes to add support in the following MRs: - MR 31575 - MR 32277 - MR 31751
The Raspberry Pi team here at Igalia presented all of their work at XDC 2024 in Montréal. You can see a video below.
Linux Kernel 6.8
A number of Igalians made several contributions to the Linux 6.8 kernel release back in March of this year. Our colleague Maíra wrote a great blog post outlining these contributions that you can read here. To highlight some of these contributions:
- AMD HDR & Color Management
- Melissa Wen has been working on improving and implementing HDR support in AMD's display driver as well as working on color management in the Linux display stack.
- Async Flip
- André Almeida implemented support for asynchronous page flip in the atomic DRM modesetting API.
- V3D 7.1.x Kernel Driver
- Iago Toral contributed a number of patches upstream to get the Broadcom DRM driver working with the latest Broadcom hardware used in the Raspberry Pi 5.
- GPU stats for the Raspberry Pi 4/5
- José María "Chema" Casanova worked on adding GPU stats support to the latest Raspberry Pi hardware.
Turnip Improvements
Dhruv Mark Collins has been very hard at work to try and bring performance parity between Qualcomm's proprietary driver and the open source Turnip driver. Two of his big contributions to this were improving the 2D buffer to image copies on A7XX devices, and implementing unidirectional Low Resolution Z (LRZ) on A7XX devices. You can see the MR for these changes here and here.
A new member of the Igalia Graphics Team Karmjit Mahil has been working on different parts of the Turnip stack, but one notable improvement he made was to improve fmulz
handling for Direct3D 9. You can check out his changes here and read more about them.
Danylo Piliaiev has been hard at work adding support for the latest generation of Adreno GPUs. This included getting support for the A750 working, and then implementing performance improvements to bring it up to parity with other Adreno GPUs in Turnip. All-together the turnip team implemented a number of Vulkan extensions and performance improvements such as:
- VK_KHR_shader_atomic_int64 - Amber
- VK_KHR_fragment_shading_rate - Danylo Piliaiev
- VK_KHR_8bit_storage - Žan Dobersek
- shaderInt8 feature - Žan Dobersek
- VK_KHR_shader_subgroup_rotate - Job Noorman
- VK_EXT_map_memory_placed - Dhruv Mark Collins
- VK_EXT_legacy_dithering - Karmjit Mahil
- VK_EXT_depth_clamp_zero_one - Danylo Piliaiev
Display Next Hackfest & Display/KMS Meet-up
Igalia hosted the 2024 version of the Display Next Hackfest. This community event is a way to get Linux display developers together to work on improving the Linux display stack. Our Melissa Wen wrote a blog post about the event and what it was like to organize it. You can read all about it here.
Just in-case you thought you couldn't get enough Linux display stack, Melissa also helped organize a Display/KMS meet-up at XDC 2024. She wrote all about that meet-up and the progress the community made on her blog here.
AMD Display & AMDGPU
Melissa Wen has also been hard at work improving AMDGPU's display driver. She made a number of changes including improving display debug log to include hardware color capabilities, Migrating EDID handling to EDID common code and various bug fixes such as:
- Fixing null-pointer dereference on edid reading
- Checking dc_link before dereferencing
- Using mpcc_count to log MPC state
- Fixing cursor offset on rotation 180
- Fixes for kernel crashes since cursor overlay mode
Tvrtko Ursulin, a recent addition to our team, has been working on fixing issues in AMDGPU and some of the Linux kernel's common code. For example, he worked on fixing bugs in the DRM scheduler around missing locks, optimizing the re-lock cycle on the submit path, and cleaned up the code. On AMDGPU he worked on improving memory usage reporting, fixing out of bounds writes, and micro-optimized ring emissions. For DMA fence he simplified fence merging and resolved a potential memory leak. Lastly, on workqueue he fixed false positive sanity check warnings that AMDGPU & DRM scheduler interactions were triggering. You can see the code for some of changes below: - https://lore.kernel.org/amd-gfx/20240906180639.12218-1-tursulin@igalia.com/ - https://lore.kernel.org/amd-gfx/20241008150532.23661-1-tursulin@igalia.com/ - https://lore.kernel.org/amd-gfx/20241227111938.22974-1-tursulin@igalia.com/ - https://lore.kernel.org/amd-gfx/20240813135712.82611-1-tursulin@igalia.com/ - https://lore.kernel.org/amd-gfx/20240712152855.45284-1-tursulin@igalia.com/
Vulkan & OpenGL Extensions
GL_EXT_texture_offset_non_const
VK_KHR_video_encode_av1
&VK_KHR_video_decode_av1
- Igalia is listed as a contributor to these extensions and worked very hard to implement CTS support for the extensions.
Etnaviv Improvements
Christian Gmeiner, one of the maintainers of the Etnaviv driver for Vivante GPUs, has been hard at work this year to make a number of big improvements to Etnaviv. This includes using hwdb to detect GPU features, which he wrote about here. Another big improvement was migrating Etnaviv to use isaspec for the GPU isa description, allowing an assembler and disassembler to be generated from XML. This also allowed Etnaviv to reuse some common features in Mesa for assemblers/disassemblers and take advantage of the python code generation features others in the community have been working on. He wrote a detailed blog about it, that you can find here. On the same vein of Etnaviv infrastructure improvements, Christian has also been working on a new shader compiler, written in Rust, called "EBC". Christian presented this new shader compiler at XDC 2024 this year. You can check out his presentation below.
On the side of new features, Christian landed a big one in Mesa 24.03 for Etnaviv: Multiple Render Target (MRT) support! This allows games and applications to render to multiple render targets (think framebuffers) in a single graphics operations. This feature is heavily used by deferred rendering techniques, and is a requirement for later versions of desktop OpenGL and OpenGL ES 3. Keep an eye on Christian's blog to see any of his future announcements.
Lavapipe/LLVMpipe, Android & ChromeOS
I had a busy year working on improving Lavapipe/LLVMpipe platform integration. This started with adding support for DMABUF import/export, so that the display handles from Android Window system could be properly imported and mapped. Next came Android window system integration for DRI software rendering backend in EGL, and lastly but most importantly came updating the documentation in Mesa for building Android support. I wrote all about this effort here.
The latter half on the year had me working on improving lavapipe's integration with ChromeOs, and having Lavapipe work as a host Vulkan driver for Venus. You can see some of the changes I made in virglrenderer here and crosvm here. This work is still ongoing.
What's Next?
We're not planning to stop our 2024 momentum, and we're hopping for 2025 to be a great year for Igalia and the Linux graphics stack! I'm booked to present about Lavapipe at Vulkanised 2025, where Ricardo will also present about Device-Generated Commands. Maíra & Chema will be presenting together at FOSDEM 2025 about improving performance on Raspberry Pi GPUs, and Melissa will also present about kworkflow there. We'll also be at XDC 2025, networking and presenting about all the work we are doing on the Linux graphics stack. Thanks for following our work this year, and here's to making 2025 an even better year for Linux graphics!
20 Dec 2024 5:00am GMT
18 Dec 2024
planet.freedesktop.org
Peter Hutterer: A new issue policy for libinput - closing and reopening issues for fun and profit
This is a heads up that if you file an issue in the libinput issue tracker, it's very likely this issue will be closed. And this post explains why that's a good thing, why it doesn't mean what you want, and most importantly why you shouldn't get angry about it.
Unfixed issues have, roughly, two states: they're either waiting for someone who can triage and ideally fix it (let's call those someones "maintainers") or they're waiting on the reporter to provide some more info or test something. Let's call the former state "actionable" and the second state "needinfo". The first state is typically not explicitly communicated but the latter can be via different means, most commonly via a "needinfo" label. Labels are of course great because you can be explicit about what is needed and with our bugbot you can automate much of this.
Alas, using labels has one disadvantage: GitLab does not allow the typical bug reporter to set or remove labels - you need to have at least the Planner role in the project (or group) and, well, suprisingly reporting an issue doesn't mean you get immediately added to the project. So setting a "needinfo" label requires the maintainer to remove the label. And until that happens you have a open bug that has needinfo set and looks like it's still needing info. Not a good look, that is.
So how about we use something other than labels, so the reporter can communicate that the bug has changed to actionable? Well, as it turns out there is exactly thing a reporter can do on their own bugs other than post comments: close it and re-open it. That's it [1]. So given this vast array of options (one button!), we shall use them (click it!).
So for the forseeable future libinput will follow the following pattern:
- Reporter files an issue
- Maintainer looks at it, posts a comment requesting some information, closes the bug
- Reporter attaches information, re-opens bug
- Maintainer looks at it and either: files a PR to fix the issue or closes the bug with the wontfix/notourbug/cantfix label
Obviously the close/reopen stage may happen a few times. For the final closing where the issue isn't fixed the labels actually work well: they preserve for posterity why the bug was closed and in this case they do not need to be changed by the reporter anyway. But until that final closing the result of this approach is that an open bug is a bug that is actionable for a maintainer.
This process should work (in libinput at least), all it requires is for reporters to not get grumpy about issue being closed. And that's where this blog post (and the comments bugbot will add when closing) come in. So here's hoping. And to stave off the first question: yes, I too wish there was a better (and equally simple) way to go about this.
[1] we shall ignore magic comments that are parsed by language-understanding bots because that future isn't yet the present
18 Dec 2024 3:21am GMT
17 Dec 2024
planet.freedesktop.org
Donnie Berkholz: The lazy technologist’s guide to staying healthy
TL;DR - I've lost a ton of weight from mid-2023 to early 2024 and maintained the vast majority of that loss. I've also begin exercising and had great results in my fitness and strength. Here, I'm sharing what I've learned as well as a bunch of my tips and tricks. Overall on the diet side, it's about eating a wide variety and healthy ratio of colorful, minimally processed whole foods, with natural flavor and sweetness, only during meals. On the exercise side, I do both cardio and resistance training. For cardio, I focus on post-meal, moderate-intensity cardio (specifically, 1-mile brisk walks). For strength training, I use calisthenics-based compound exercises (complex multi-muscle movements) 2x/wk, performing a single set to near-exhaustion. I've optimized this down from 3 sets 3x/wk, based on my experience and academic research in the area.
In the past 18 months, I've lost 75 pounds and gone from completely sedentary to fit, while minimizing the effort to do so (but needing a whole lot of persistence and grit). On the fitness side, I've taken my cardiorespiratory fitness from below average to high, and I'm stronger than I've been in my entire life. Again I've aimed to do so with maximum efficiency, shooting for the 80% of value with 20% of effort.
Here's what I wrote in my initial post on weight loss:
I have no desire to be a bodybuilder, but I want to be in great shape now and be as healthy and mobile as possible well into my old age. And a year ago, my blood pressure was already at pre-hypertension levels, despite being at a relatively young age.
Research shows that 5 factors are key to a long life - extending your life by 12-14 years:
- Never smoking
- BMI of 15.5-24.9
- 30+ min a day of moderate/vigorous exercise
- Moderate alcohol intake (vs none, occasional, or heavy)
- Unsurprisingly, there is vigorous scientific and philosophical/religious/moral debate about this one. However all studies agree that heavy drinking is bad, so ensure you avoid that.
- Diet quality in the upper 40% (Alternate Healthy Eating Index)
Additionally, people who are in good health have a much shorter end-of-life period. This means they can enjoy a longer healthy part of their lives (the "healthspan") and squeeze the toughest times into a shorter period right at the end. After seeing many seniors struggle for years as they got older, I wanted my own story to end differently.
Although I'm no smoker, I lacked three other factors. My weight was incredibly unhealthy, I was completely sedentary, and my diet was terrible. I do drink moderately, however (nearly all beer).
This post accompanies my earlier writeups, "The lazy technologist's guide to weight loss" and "The lazy technologist's guide to fitness" Check them out for in-depth, science-driven reviews of my experience losing weight and getting fit.
Why is this the lazy technologist's guide, again? I wanted to lose weight in the "laziest" way possible - in the same sense that lazy programmers work to find the most efficient solutions to problems. I'll reference an apocryphal quote by Bill Gates and a real one by Larry Wall, creator of Perl. Gates supposedly said, "I choose a lazy person to do a hard job. Because a lazy person will find an easy way to do it." Wall wrote in Programming Perl, "Laziness: The quality that makes you go to great effort to reduce overall energy expenditure. It makes you write labor-saving programs that other people will find useful and document what you wrote so you don't have to answer so many questions about it."
What's the lowest-effort, most research-driven way to lifelong health, whether you're losing weight, getting in shape, or trying to maintain your current healthy weight or state after putting in a whole lot of time and effort getting there? Discovering and executing upon that was my journey. Read on if you're considering taking a similar path.
Hitting my goals
Since my posts early this year, I broke through into my target ranges for both maintenance weight and fitness. In mid-April, I hit a low of 164 lbs. Since then, I've been gradually transitioning into maintenance mode, hovering within ~10 lbs of my low. As I write this, I'm about 10 pounds above my minimum weight, at a current BMI of 23. At my lowest, I had a BMI around 22.
On the fitness side, in late May, I broke into the VO2Max range for high cardiorespiratory fitness. (In my case, that's 47 based on my age and gender, as measured by my Apple Watch.)
In the next few sections, I'll share how I've continued to change what I eat and how I work out to keep improving my overall health.
Evolving what I eat for long-term health
In this section, I'll share a lot of what I've learned regarding how to eat healthier. There's a lot to it, from focusing on whole foods with enough protein and fiber to eating enough veggies and managing portion sizes, so dig in for all the details!
Keep up the protein
As I wrote in the post on weight loss, high protein is a great way to lose weight and maintain or build muscle. Protein also promotes fullness, so I've shifted my diet so that every meal (breakfast included) has a good amount of protein - targeting 25%-30% of daily calories. Previously, I used to get quite hungry in the late morning, before it was time to eat lunch. That's no longer a concern even when I'm on a caloric deficit, let alone eating at maintenance.
Use Mediterranean plate ratios
Although I'm not officially eating a Mediterranean diet, I've found its plate ratios to be incredibly valuable:
- 1/2 vegetable
- 1/4 lean protein (white meat, seafood, lentils/beans)
- 1/4 starchy carb (whole grains or starchy vegetables, avoiding white/processed grains)
Building meals that way makes it very hard for me to overeat, because the vegetables are so high-volume and low-calorie that they take up a lot of space in my stomach. Following this guideline is especially helpful at restaurants, which I'll detail later.
My main exception is breakfast, where I do incorporate veggies but not as half of my meal. Veggies plus fruits are certainly half of it, though.
Count calories for a while, and then set a permanent weight-gain trigger
After overeating for a sizable fraction of my lifetime, and then eating at a large deficit for a year, I need to teach myself what sustainable eating habits look like because they clearly aren't intuitive, for me. The "intuitive eating" trend may work for people who already have a habit of healthy eating and weight maintenance, but not for the rest of us - our intuition is broken from years or decades of bad habits.
As a result, calorie counting at maintenance is a good practice to learn what the correct amount of food per day looks and feels like.
My plan is to continue counting calories at maintenance until I'm confident that I'm no longer gaining weight, and then stop. However, that raises the risk that my weight could then start increasing again, because it's incredibly common for people to re-gain the weight they've lost. Around 80%-90% of people fail to maintain their weight loss - mostly those who don't exercise and stop tracking their eating/weight. There's great studies on the US National Weight Control Registry about the habits of people who keep their weight off.
As a process control, I'm going to continue weighing myself daily. I'm setting an upper limit of 5 pounds above my target weight that will trigger me to begin calorie counting again. To avoid reacting to the random deviations that accompany daily weight, I've started using a specialized app called Happy Scale that is designed for creating smoothed trends for body weight. You could also do this in a spreadsheet, but I like the ease of use of this app.
Dine out at restaurants, safely
Eating out at restaurants (or getting takeout/takeaway) is a challenge that a lot of people on diets - or just trying to eat healthy - can't figure out how to make work. A lot of people just give up and always order a salad. Surprisingly, that can trick you into thinking you're eating healthy without actually doing so. I've created a set of guidelines that I follow when eating out:
- Aim for lean protein & veggies, prepared simply (e.g. grilled, roasted, sautéed, steamed).
- Always start with veggies. If your meal doesn't come with them, order a starter salad or veggies as an appetizer.
- Minimize high-fat, calorie-dense sauces & toppings. Watch out for anything based on cream (like Alfredo sauce), cheese, mayo (aioli), oil, or butter. A little bit of a high-flavor cheese is great (like finely grated parmesan, or crumbled feta/goat cheese), but avoid the cheese sauce or a big pile of shredded cheese. Get meals served with tomato-based sauces, slices of lime/lemon or just spices/seasonings, which bring tons of flavor without the calories. If it comes with a calorie-dense sauce, ask for it on the side and dip your bites instead of getting your meal drenched in it. You'll often be shocked by how big of a cup they provide for the sauce, which would've been coating your food.
- In salads, always get dressing on the side, and prefer oil & vinegar or a vinaigrette. Do the same with any other high-fat sauces - get them on the side. That way, you're in control of the portion, or you can just dip bites. Salad dressings can have hundreds of calories in them. If you add a huge pile of cheese and croutons, and maybe some processed meats like pepperoni or some oil-covered pasta, then you've just turned a healthy meal into the opposite.
- Avoid breaded, deep-fried foods. This includes the protein as well as French fries or chips/crisps.
- Don't eat the table bread when it comes out first at a restaurant. Eat veggies, then protein, and only then starchy carbs. Remember, only 1/4 of your meal can be starchy carbs, according to the Mediterranean plate ratio (bread, rice, pasta, potatoes, etc).
- Avoid meals that are 1/2 or more starchy carbs.
- Only eat half of what you order, because restaurant portions are massive. Restaurant portions are big enough for 2 meals, sometimes 3. Split it physically on your plate when you get it, and ask for a box as soon as possible.
As one example, I love burgers. When I order one, I'll look for a healthier, simpler option instead of the one with 15 fatty add-ons, I'll stick with a single patty instead of a double, and I'll often ask for the aioli on the side. That way, I can lightly dip each bite if it needs the flavor. I'll frequently get a turkey or bison patty instead of beef, and I'll often order it without a bun - either on a bed of lettuce (eaten with a fork & knife), or wrapped in lettuce instead of the bun. For the side, instead of fries, I'll get a side salad (no croutons, no cheese, vinaigrette on the side), veggies, or fruit. Sometimes I'll get coleslaw or a lower-calorie soup, when that's the best option. I allow myself one "extra" from my guidelines, and it's usually getting cheese on the burger (the other toppings are veggies).
As another, noodle/rice dishes at Italian, Indian or SE Asian restaurants (Chinese, Japanese, Vietnamese, Japanese, etc) are common. Get a stir-fry, add lots of veggies, get the grilled/roasted chicken or seafood, avoid the buttery/creamy sauces, and/or eat less of the rice/noodle part of the dish. If you get sushi, prefer sashimi and rolls over nigiri, which has a lot more rice. When you do order starchy carbs, prefer the whole-grain version when possible (brown rice, whole-wheat pasta, etc). When you can make it work, first eat the veggies, then protein, then grains.
Sometimes you're stuck at a place that doesn't fit any of those guidelines. Fast-food restaurants like McDonald's, Burger King, or Dairy Queen have no healthy meal options - no grilled chicken, no salad or wraps without fried food, etc. In those cases, I'll order smaller portions, like a kid's meal, or a single cheeseburger and the smallest size of fries (the one that comes in a little bag instead of a fry holder), with a cup of water. Another option is a double fish sandwich, if you order it without tartar sauce and skip the bun. You can probably manage a meal around 500-600 calories, but you'll be hungry because you hardly got any veggies or fiber, so you're missing out on fullness signals. You also will have eaten all kinds of ultraprocessed ingredients instead of healthy whole foods, which we'll discuss later.
Eat like it's the 1950s
In the US, if you go back to before we had ultraprocessed foods, people ate very differently. Most of that emerged in the 1960s and really gained popularity in the 1970s, so let's return to the 1950s.
Eat a savory breakfast
Before we had overwhelmingly sugar-doused cereal, people often ate breakfast differently. It might be leftovers from the night before, or it could be oatmeal, peanut-butter toast, or something like eggs & bacon. In general, breakfasts were much more savory than sweet.
I've adopted that philosophy, shifting away from breakfasts like sweet cereal or flavored yogurt (both with plenty of added sugar) to a more savory approach, or at least foods with no sugar added. Most often, I'll have something with eggs and beans, as well as a separate bowl with berries and plain skyr or Greek yogurt. The fruit adds plenty of flavor and sweetness, so there's no need to add any more from sugar/honey/etc.
Eliminate snacks
Before ultraprocessed foods, snacks also weren't really a thing. There weren't food companies trying to create opportunities for profit through people eating outside of typical meals. You'd eat breakfast, lunch, and dinner, and that was it. Eating random snacks throughout the day didn't really exist, although some families might have an extra mini-meal of sorts at some point.
Decrease portion size by decreasing plate size
Additionally, portion sizes have increased dramatically. In part, this is because plateware has increased in size. For example, the diameter of plates has increased from 9″ in the 1950s to 10.5″-11″ between the 1980s and 2000, and as much as 12″-13″ today. People will subconsciously take larger portions and eat more calories when their plates are larger, as academic studies have shown.
This brings us to another easy thing I did to eat healthier - reduced the size of my plates, bowls, and glasses. Even without buying new plates, I started only adding food to the "inner ring" instead of all the way to the edge, and stopped piling anything on top of other food. I bought new, smaller bowls and glasses, because those were harder to manage. And when I eat out or get takeout, I have a mental baseline to compare to their plate sizes. I also watch out for the use of multiple courses to keep me from thinking about how much I'm eating.
To sum up, I switched to a savory breakfast, eliminated snacks outside of meals, and reduced the size of my plateware. Even if you only do 1 or 2 of those 3 things, that'll make a meaningful difference.
Ultraprocessed foods trick your body
I've read quite a bit about ultraprocessed foods. The summary is that they are effectively ways to trick your body into thinking it's getting something that's not really there. Artificial sweeteners, things with the taste & consistency of fat that have no fat, and artificial/natural flavors in foods that make your body expect something else are just a few examples.
Sugar that's not sugar
When your body tastes something sweet, it expects that it will soon get an influx of calories from sugar to digest. Artificial sweeteners mess with this, tricking your body. A number of studies have shown that people tend to make up for these "lost" calories by subconsciously eating more later that day. It's possible to prevent this with strict calorie counting, but it's a bias you want to be aware of. It's also unclear what these mixed signals will do to your body over the long term, when it can't tell what calories to expect based on what you taste. As a result, I've begun avoiding alternative sweeteners, and just getting something with sugar if that's really what I want.
Fat that's not fat
This one is especially sneaky, because you can't always spot it in the ingredient labels. Using seemingly normal ingredients, companies have created fat substitutes with unique structures that provide the same sort of mouth-feel as fat, without containing the expected levels of fat. These can come in the easily identifiable varieties such as all sorts of "gum" - this results in ice cream that basically doesn't melt, for example. "Whey protein concentrate" is another common one, as is anything with "dextrin" in the name and a variety of emulsifiers such as "polyesters." You need to work (and typically pay a premium) for things like ice cream or chocolate with a simple ingredient list, because natural ingredients cost more and often don't transport as well.
Flavor that's not flavor
Flavors in the wrong foods are another example of tricking your body into expecting a different set of nutrients than it gets. This can cause you to develop craving for unhealthy foods, based on your desire for a particular flavor profile that comes from added flavorings. For example, you might want some orange-, apple-, or grape-flavored drink instead of actual oranges, apples, or grapes. Your body will cause you to crave certain things based upon their nutrient profile, and what your body needs. This is most obvious in pregnancy and in studies done on babies/toddlers, given free choice on what to eat.
Micronutrients that don't belong
"Enriched" foods are stealing your health, again based on artificially induced cravings for unnaturally added ingredients. A good case study here is flour in bread. In the early 1940s, the United States passed a law requiring enrichment of bread flour to prevent diseases around missing micronutrients (e.g. folic acid, niacin, thiamin, riboflavin, iron). Italy, however, did no such thing - instead, it focused on educating its citizens on healthy diet components. As a result, Italians eat far more beans than Americans, for example, which contain many of the same missing micronutrients. Americans instead eat far more white bread than they should - an ultraprocessed food that our body desires because of the added micronutrients that don't belong.
Salt that's over the top
Overly salty foods are another danger area. In the US, the recommended amount is 2300 mg/day, which it's quite easy to hit even while trying to avoid extra-salty foods. For example, I mostly don't eat ramen, other soups, preserved meats like smoked salmon or beef jerky, or frozen meals. Another surprising one is sugar-sweetened beverages like soda, which have so much sugar that they also add salt to trick you into feeling like they aren't that sweet.
Optimize for gut health
Another area that's become increasingly visible in the past couple of decades is the importance of gut microbiota in health. Keeping them healthy is critical to being healthy. That's come down to a few key factors for me: fibers, fermented food, and reduced alcohol.
Eat enough fiber - and that's a lot!
The average American only eats 10-15 grams of fiber per day, while the recommended daily allowance for adults up to age 50 is 25 grams for women and 38 grams for men. I see this as a general correlation with our consumption of ultraprocessed foods, because fiber is primarily present in whole foods. Whole fruits, whole vegetables, whole grains, legumes (beans/lentils), and seeds are among the best sources of fiber.
As soon as you stop eating the whole, unprocessed food and replace it with something more processed, you lose the benefits. Make sure to eat the whole fruit, including the edible portion of the skin. Even something as simple as making a fruit smoothie or fruit juice will chop up or remove the fiber and other long-chain complex molecules, reducing its nutritional value. Personally, I found it surprisingly hard to modify my diet enough to get enough fiber while I was losing weight, because I'd been eating ultraprocessed foods for so long. In the end, the main things I added were raspberries & blackberries, chia seeds, broccoli & cauliflower, and beans/lentils.
Among fruit, raspberries and blackberries are particularly high fiber (you can tell from all the seeds as you're eating them). Other great options include apples, oranges, pears, grapefruit, and kiwifruit, as long as you eat the edible portion of the skin & rind. Passion fruit is an all-star with many times more fiber, but it's quite expensive. Dried fruit can be a great complement to fresh fruit in moderation - especially golden berries (another all-star), plums, and apricots. It's easy to eat too much dried fruit, though, because all the water's been removed so it doesn't fill you up as quickly. For example, you can eat 5 dried apricots in a few minutes, but imagine eating 5 fresh apricots in a row.
Vegetables are another great source of fiber, but again you need to focus on the right ones. Among non-starchy options (basically anything but root vegetables), broccoli and cauliflower are great choices, as is kale. I like to begin my meals with one of those, whenever I can. Among starchy options, sweet potatoes, carrots, and corn are great choices.
Whole grains (such as whole-wheat bread, the denser the better, and brown rice) are also high in fiber, but they tend to have lots more carbs - while I optimized more for protein. When I'm eating at maintenance, I occasionally have some dense whole-grain breads such as a Danish pumpernickel or a German roggenbrot/vollkornbrot. They're nothing like your typical American pumpernickel or rye, so try to find a bakery near you that offers them. Otherwise, any 100% whole-grain bread (they often have a stamp) with low sugar and a decent amount of protein & fiber are a good option. Any bread with no sugar is even better, but it's hard to find. I'd recommend checking out local bakeries first, then the bakery within your favorite grocery store, followed by national brands such as Dave's Killer Bread or Ezekiel from Food for Life.
Legumes & seeds are a great source - I've saved perhaps the best for last. Beans and lentils are fiber superstars - a single serving around 100 calories could have 5-10 grams. They also offer a complete set of protein (all 20 amino acids) when combined with a whole-grain rice, such as brown, red or purple. I have a serving of black beans with eggs almost every day.
Fermented foods improve gut health
Another great way to improve the types of gut microbiota is eating more fermented foods. These are more common things in the US like yogurts and sauerkraut, as well as cultural food like Korean kimchi, increasingly popular drinks like kombucha, and less common drinks like kefir (basically drinkable yogurt). The benefits seem to fade away after just a few weeks though, so it's important to maintain consumption instead of thinking you can transform your microbiota once and then you're done.
I'm regularly eating skyr, which is a thick Icelandic yogurt with as much protein as Greek yogurt but not the tangy, bitter flavor. It's a great protein-dense option, even when you eat the version based on whole milk (which I do). I'm also occasionally using kimchi on my eggs or drinking a small half-glass of kefir. Sauerkraut is reserved for summer barbecues, and I haven't gotten into kombucha at this point.
Moderate your alcohol intake
Another thing that made a big difference was reducing the amount of alcohol I drink. Cutting this down from a beer every day to more like once a week has made a big difference. I'm overall feeling more energetic and my gut's much healthier too.
Appreciate the sweeter (natural) things in life
As I learned more about eating healthy, I came across increasing amounts of material about how added sugar caused major problems, leading toward obesity or diabetes. Interestingly, many parts of the world eat far less sweet food, and there tends to be a general correlation between consumption of ultraprocessed sugary food and obesity. In my own life, I've noticed this difference in practice when traveling to Europe and Asia, where many of the desserts are far less sweet (and the obesity rate is much lower). Two great examples are Polish cheesecake (sernik) - which is far less sweet than American cheesecake - and the frequent use of less-sweet ingredients in Asia such as red bean, sesame, or glutinous rice.
Based on this, I've cut down on foods with added sugar. Natural levels of sugar are generally fine, such as that in many fruits, but even then I try to bias toward less-sweet options. For example, I'll typically have an apple or pear instead of mango. Among dried fruit, I avoid dates and figs, tending toward lower-sugar options instead.
Once you start looking, it's shocking how seemingly every processed food has added sugar. This goes all the way down to even basic staples such as bread, unless you specifically look for the rare breads without it.
In America, we've trained ourselves from birth (with sweetened baby food) to eat sweeter and sweeter foods with more and more unnatural levels of sugar, to the point where it tastes too sweet or even sickening to people from other cultures.
As a pleasant side effect of this, I find myself enjoying moderately sweet foods almost in the same way that I used to think of desserts. Fruit like strawberry or mango, chia pudding or overnight oats w/ fruit and no other sweetener, frozen Greek yogurt bars, skyr with cinnamon and just a little honey, dried fruit, trail mix, or 85%+ dark chocolate now taste great.
Try the "No S Diet"
While on my journey, I came across a simple approach called the "No S Diet" that I quite appreciated. It boils down healthy eating into just three rules and one exception:
- No Snacks
- No Sweets
- No Seconds
Except (sometimes) on days that start with "S"
Even this alone would get you a long, long way. Combining it with a Mediterranean diet (plate ratios, whole foods, lean protein) is almost all you need.
I have stopped snacking entirely, as mentioned earlier. I'm a bit more flexible on sweets, if they fit into my calories for the day, but I do try to save more of that for the weekend. For example, I might have a little 85%+ dark chocolate on a weekday after lunch, or some strawberries w/ whipped cream after dinner, but I'll eat a full dessert serving on the weekend.
Eat in the right order
Interestingly, I also learned that even the order in which you eat can make a difference. Specifically, you can flatten blood-sugar spikes by eating in a specific order: fiber, then protein, then starchy carbs.
For example, start with a salad, then eat the main portion of your entree (e.g. chicken or fish), followed by the sides (rice, potatoes or whatever).
This has served me well at home, but it's been especially helpful at restaurants. Every time I go out, I make a point of ordering either a salad or a veggie-based appetizer to enjoy before the main course. Eating in this specific order isn't the only reason that helps - it also uses up a bunch of the room in my stomach on veggies instead of more calorie-dense foods, so I'm often full enough before I finish my starchy carbs.
Add antioxidants
Antioxidants are another great way to eat healthier. These protect your body at a subcellular level from oxidizing reactions, which can damage parts of your cells (especially the mitochondria, basically your cell's energy factory) over time and contribute to aging.
An easy way to identify foods with higher levels of antioxidants is to look for more color. Instead of the bland-looking food, pick one with a stronger color. It could be dark green, red, orange, blue, purple, or something else - just avoid white and beige options within a food family. Although there are many exceptions, this is a good guideline.
Remember: eat the rainbow.
Go for whole grains and prefer resistant starches
Whole grains are hugely more valuable than the more processed options. You get the germ, which has a lot of the nutrients. With your typical American white bread, a lot of the healthy bits are removed (the germ and bran), leaving you with only the endosperm. With whole-grain bread, the germ and bran are also used, which keeps more of the fiber and micronutrients. This also reduces the blood-sugar spike after meals, which is another great benefit.
Another thing I learned is that there are different types of starches - rapidly digested, slowly digested, and resistant.
Resistant starch takes longer to digest, flattening some of the glucose spikes that can create hunger cravings a couple of hours after meals. Two of the best examples of those are whole grains (type 2 resistant starch, or RS2) as well as pasta, potatoes, or rice that's cooked and then cooled (type 3, or RS3).
One way to prefer resistant starch is to aim for foods that are higher in amylose and lower in amylopectin. Amylose is a single straight-chain polymer, so it takes longer to break down and digest, whereas amylopectin is branched with many ends (so it's faster to break down in parallel). That parallel breakdown means you get a sugar spike rather than spreading out the sugar over time. In general, this means whole grains over processed grains, and the more colorful versions of foods. Here are some examples:
- Bread: Whole-wheat/pumpernickel/rye > sourdough/multigrain/50% wheat > white
- Rice: Purple/black/red/wild > brown > long-grain white > short-grain white
- Pasta: Bean-based > whole-wheat > standard (durum)
- Potatoes: Stokes/Okinawan (purple inside) > sweet > white
- Oats: Steel-cut > rolled > instant
Another way to get more resistant starch is to eat more grains that were cooked and then cooled. Pasta salad, potato salad, grain bowls, and reheating leftover rice are a few common examples. Yes, that reheated Chinese stir-fry w/ rice can be healthier than it was when you ordered it!
Get nutrients from whole foods, not pills & powders
A lot of people try to add missing nutrients to their diet in the form of a multivitamin or a large variety of supplements. Unfortunately, research has shown that despite containing the same chemical compounds, this is frequently not a substitute. The bioavailability (the amount that actually makes it into your bloodstream) is often much higher when you eat these micronutrients as part of whole foods, rather than taking them in a pill or as powders.
Protein powder is another issue. A lot of people will make protein shakes or add protein powder to foods like yogurt to get enough protein. Unfortunately, protein powders are missing a lot of the nutrients that protein-based whole foods contain. For protein shakes specifically, the below point applies regarding drinking your calories and its poor effect on satiety. If whole foods aren't an option, I'd recommend looking into protein bars with high fiber rather than a liquid option. RXBar is my favorite protein bar because of its simple ingredient list, high protein & fiber content (12g protein, 5g fiber) and good flavor, and it's well-priced at Costco at ~$1.25/bar vs $2 elsewhere. When I need a packable meal replacement that doesn't require refrigeration, I'll usually grab an RXBar, a Wholesome Medley trail mix (from Whole Foods), and an apple or pear.
Avoid drinking your calories - focus on low- or no-calorie beverages
Overall, drinking calories can confuse your body into consuming too many calories in a day. Your primary beverage should be water. That should be complemented primarily by low-calorie, unsweetened options like coffee or tea (potentially with milk and minimal sugar).
Drop the sugar-sweetened beverages, like soda
Soda and other sugar-sweetened beverages are not recognized by the body as consumed calories. When you consume 500 calories soda, you're likely to increase your total daily consumption by 500 calories (gaining weight) instead of eating less food later. Not to mention, if you drink sugar-sweetened beverages frequently throughout the day, you're also destroying your teeth and potentially giving yourself diabetes.
Eat your meals instead of blending them into smoothies
Smoothies destroy much of the nutritional value in whole fruit, such as fibers and other complex molecules, because it's ground up into tiny bits by a blender. They also make it much easier to consume far more than you normally would. How much fruit goes into a single smoothie, compared to how many whole fruits you would eat in a single sitting?
Drop the sugary alcoholic drinks
Alcohol is another place to be careful. Cocktails are full of sugar from the simple syrup. Trying to save calories by getting a basic mixed drink with Diet Coke? Then you've got artificial sweeteners. Your best liquor-based option is probably a mix with soda water and lime - things like a vodka soda, ranch water, gin Rickey, or whiskey highball. High-alcohol beers have incredibly high calorie counts as well. There are some good options for low-calorie or non-alcoholic beer, which I covered in an earlier post.
For coffee, stick to the classics in the smallest size (4-8 oz)
Coffee-based drinks can be incredibly high-calorie, especially in the US. Mochas and blended/frozen drinks can be 500-1000 calories or more, for a single drink. This is especially harmful because of the American tendency to order the largest size instead of the smallest - it's a better deal, right? A Starbucks Java Chip Frappuccino is 560 calories for a venti (large). But this pales in comparison to Caribou Coffee, which offers drinks like the Turtle Mocha for 960 cal (L) / 1140 (XL) or the Caramel Caribou Cooler for 830 cal (L) / 1050 (XL). At Dunkin', you can get the Triple Mocha Frozen Coffee at 1100 cal (L) and the Caramel Creme Frozen Coffee at 1120 cal (L). So keep your eyes open on any specialty coffees.
When drinking coffee, go for the classics. If you don't like black coffee or espresso, then get a latte, cappuccino, flat white, cortado, or espresso macchiato. Out of those, lattes have the most milk (so the most calories), while espresso macchiatos have the least.
Also, order the smallest possible size - this is also the most authentic size, with a better ratio of espresso to milk. Starbucks carries a short size (8 oz) that isn't on their printed menu, but unfortunately many other chains only offer 12 oz as their smallest size. Third-wave coffee shops often have 8 oz or smaller sizes as well, especially for classics like a cappuccino or flat white.
One trick if you want to order a seasonal or flavored latte is that most coffee shops have a "1/2 sweet" option that uses half the syrup, which is usually more than sufficient to add flavor. I'll often order the smaller-sized cappuccino plus 1/2 the seasonal syrup instead of a latte, which gives me a similar experience in a smaller portion size and lower price.
Non-dairy milks at coffee shops are often full of unnecessary additives and over-sweetened, so try skim milk instead of almond/coconut milk if your goal is lower calories. Non-dairy milks are also full of empty carbs, whereas dairy milk has much more protein. For a richer drink, upgrade to whole milk and add a bit of sugar yourself if needed, instead of letting the barista pour in a huge amount of sugar-packed flavor syrup.
Give tea a try
Another great zero-calorie option is tea. Experiment with different teas, whether it's black, green, white, masala chai, or an herbal non-caffeinated tea. The only calories come from any milk or sugar you add, but try appreciating the flavor of the tea alone. If you don't like it, maybe you want to upgrade to higher-quality teas. I particularly like the herbal options from Celestial Seasonings and Twinings. Tazo, Rishi, and Stash come well-recommended as tea brands you can find at many places in the US. If you really get serious, you'll probably upgrade to loose-leaf tea from a local shop.
Overall, minimize the calories in your drinks. Water, coffee (but not mochas / frozen drinks), and tea are great options, while you should minimize smoothies, soda, and alcohol.
But what do meals actually look like?
That seems like a ton of restrictions and rules, right? How can you, or I, keep track of them all? Overall, it's about eating a wide variety and healthy ratio of colorful, minimally processed whole foods, with natural flavor and sweetness, only during meals.
Here's some examples for a day at 1500 calories (a 1000-calorie deficit):
Breakfast
I eat the same thing almost every day, aiming for a savory breakfast rather than a sweet one. The only things I change are additions to the eggs. The veggies vary, and sometimes I substitute salsa with kimchi or sriracha.
- 2 scrambled pasture-raised eggs, with 2 diced mushrooms, 1/3 diced heirloom tomato, low-sodium lentils / black beans, and sriracha
- 250g (~9 oz) Costco three-berry blend of blackberries/raspberries/blueberries (microwaved), combined with 90g (~3.5 oz) whole-milk skyr and 15g (~1 tbsp) chia seeds
- 110g (~4 oz) kefir (fermented milk)
Lunch
Every day for lunch, I'll have a side salad, a veggie plate, or an entree salad with lean protein in it. I aim for flavorful veggies that don't require any sort of dip - try your local farmer's market for better-tasting veggies than the grocery store carries.
- Big salad with Costco power greens (kale, spinach, baby chard), dressed with 1 tsp extra-virgin olive oil, vinegar, salt, and pepper
- 115g (~4 oz) pulled chicken with mustard-based BBQ sauce
- 200g (~7 oz) Stokes/Okinawan sweet potato with 1 tsp grass-fed butter
Usually my protein is chicken, canned tuna, canned salmon, or frozen, pre-cooked shrimp. On other days, I might make a chicken-salad open-faced sandwich, or the same with tuna salad. Sometimes I'll put smoked salmon on Wasa crackers, or I'll add salmon or shrimp to my salad. I'll also regularly have tacos with chicken/shrimp, corn tortillas, veggies, salsa, and skyr (instead of sour cream).
Dinner
This day, I ate out at a burger restaurant. Here's the healthier option I constructed, using Mediterranean ratios and my other guidelines:
- Crispy Brussels sprouts for a starter
- Bison burger (6 oz / 180g patty), no bun, on a bed of lettuce and tomato
- Topped with ~1 tbsp fig jam and ~15g blue cheese (I scraped off half of the blue cheese and got the fig jam on the side, so I could control the portion)
- Side of steamed broccoli with butter
Maintaining weight is just as hard as losing it
One of my biggest challenges has been making this transition into a sustainable diet, after depriving myself of many foods I enjoy for the past year. In particular, it's extremely hard to avoid eating too many desserts or snack foods with added sugar, especially when I'm toward the lower end of my target weight range.
I speculate that this is partially related to "set point" theory. My body's used to being much heavier, and it will take time for my body to realize that I'm healthy at this new level rather than trying to survive a famine, where I should try hard to eat high-calorie foods whenever I come across them. Exercise also helps in maintaining weight loss (there's a study done on police officers who continued exercise post-weight-loss vs those who didn't, and a variety of examples from the National Weight Control Registry).
Fitness is a lifelong journey
On the fitness side, I've taken an even more efficiency-optimized approach than I had before, with continued success.
I found my energy levels getting extremely low as I approached my target weight while maintaining a large calorie deficit. This prompted me to experiment with whether I could decrease my frequency and intensity of exercise, while still getting most of the results.
Dropping HIIT with no hit in results
I kept my daily walks for low-intensity steady state (LISS) cardio exercise, although I've adapted them slightly into 3 per day - with a 15-minute walk after each of my 3 meals. However, I experimented with dropping the high-intensity interval training (HIIT).
Surprisingly, my VO2Max (a measure of cardiorespiratory health) continued to increase at almost the same rate as before. My plan is to watch for a plateau in VO2Max, and consider re-introducing HIIT at that point. Alternately, if I ever get too short on time to continue with enough LISS, I could replace it entirely with my extremely low-volume HIIT program.
I would like to re-add HIIT at some point because a mixture of different intensities is overall better than just one. However I frankly don't enjoy HIIT so I'm not in a big rush, until I have a clear need (like I mentioned above).
Simplifying and reducing strength training
I was also doing strength training 3x/week, with 3 paired sets per workout. I've replaced that with a 2x/week pattern, also dropping from 3 to only 1 paired set - importantly, performed to near-failure. Again, I've seen nearly equivalent results. Upon reviewing the academic research and expert recommendations in this area, many experts suggest that sets 2 and 3 essentially serve as "insurance" that you've maximized your potential growth in strength & size during a workout. At worst, doing a single set might offer more than 50% of the total benefit of any number of sets. That means a single set - if done well - could provide a majority of the benefits in just 1/3 of the time. This fits nicely into my 80/20 philosophy.
If you'd like to look into this in more detail, go on Google Scholar and look up "resistance training single-set OR one-set review OR meta-analysis." In general, the research shows a dose-dependent response (more sets produce better results), but there's diminishing returns from each additional set. You need to carefully look at the effect sizes, comparing the effect size of one set to the effect size of multiple sets. There will often be statistically significant differences, but the effect size is the important part. It's not about whether the difference is real, it's about how big it is. Overall, if you're optimizing for efficiency on time spent working out rather than maximizing muscle growth in a certain period of time (e.g. a year), single sets can be a great approach. My perspective is that I'll be doing this for the rest of my life, and I'll be moving increasingly slowly toward a plateau of my biological maximum strength, so I don't really care how many years it takes.
I may find that I need to increase my set count as I get more experience with strength training, and my "newbie gains" gradually fade away. We'll see how things continue to develop over time, and whether I hit a plateau where that might be an option I try.
My current strength training routine continues to use a similar routine as described in my last writeup. I use the 8×3 app to track my progressions & progressive overload, and I alternate between two routines, both of which are full-body workouts with compound movements:
Day 1: Vertical push/pull (+core & legs). L-sit pull-ups, dips / handstand push-ups, squats, Nordic curls.
Day 2: Horizontal push/pull (+core & legs). Horizontal rows, push-ups, squats, Nordic curls, hanging leg raises.
Each exercise is part of a progression toward more advanced, lower-leverage movements that will continue to build strength, without the need to use any weights. For example, I'm specifically working on pistol & shrimp squats, handstand push-up negatives, pseudo planche push-ups, L-sit pull-ups, and tucked front levers.
I've added two more low-cost, small, and portable pieces of equipment to make this easy, bringing my total to three pieces. I'd already purchased a doorway pull-up bar ($26). Since then, I've added gymnastics rings ($32) hanging from the pull-up bar. Rings are extremely flexible - I use them for horizontal rows and dips, but they can be used for ab roll-outs, pull-ups (instead of the bar), and so much more. I'm also using a Nordstick ($27, or a bit more for the Pro) that slides under a closet door, because Nordic curls are tricky without some sort of specialized device. An alternative, equipment-free exercise is a reverse hyperextension, but the unweighted version will plateau pretty quickly.
Overall, I've further reduced the time commitment from exercise without significant impact. I've removed HIIT, maintained LISS (daily, 15 min x 3), and reduced strength training (2x/wk, 10 min x 1), and I still see nearly equivalent outcomes.
I'm not just maintaining my fitness and strength - it's continuing to grow, even without any caloric surplus. I do expect that re-composition to plateau within a year or two at a maintenance diet. At that point, I may need to do mini bulks and cuts (gaining/losing weight in cycles to grow my muscle mass).
Learn more
Want to learn more? Here's some books that I've found helpful, roughly in order. I've also shared my Kindle highlights for each one, in case you want to see my perspective on the key points before reading the full book.
- Ultra-Processed People (my Kindle highlights)
- Metabolical: The Lure and the Lies of Processed Food, Nutrition, and Modern Medicine (my Kindle highlights)
- Glucose Revolution: The Life-Changing Power of Balancing Your Blood Sugar (my Kindle highlights)
- Salt Sugar Fat: How the Food Giants Hooked Us (my Kindle highlights)
- Sugarless: A 7-Step Plan to Uncover Hidden Sugars, Curb Your Cravings, and Conquer Your Addiction (my Kindle highlights)
- The No S Diet: The Strikingly Simple Weight-Loss Strategy That Has Dieters Raving-and Dropping Pounds (my Kindle highlights)
- Ravenous: How to get ourselves and our planet into shape (my Kindle highlights)
- The Way We Eat Now: How the Food Revolution Has Transformed Our Lives, Our Bodies, and Our World (my Kindle highlights)
- Spoon-Fed: Why Almost Everything We've Been Told About Food is Wrong (my Kindle highlights)
- Food for Life: The New Science of Eating Well (my Kindle highlights)
- The Dorito Effect (my Kindle highlights)
- The End of Craving: Recovering the Lost Wisdom of Eating Well (my Kindle highlights)
- Lose It Forever: The 6 Habits of Successful Weight Losers from the National Weight Control Registry (my Kindle highlights)
17 Dec 2024 9:05pm GMT
16 Dec 2024
planet.freedesktop.org
Lennart Poettering: Announcing systemd v257
Last week we released systemd v257 into the wild.
In the weeks leading up to this release (and the week after) I have posted a series of serieses of posts to Mastodon about key new features in this release, under the #systemd257 hash tag. In case you aren't using Mastodon, but would like to read up, here's a list of all 37 posts:
- Post #1: Fully Locked Accounts with systemd-sysusers
- Post #2: Combined Signed PCR and Locally Managed PCR Policies for Disk Encryption
- Post #3: Progress Indication via Terminal ANSI Sequence
- Post #4: Multi-Profile UKIs
- Post #5: The New sd-varlink & sd-json APIs in libsystemd
- Post #6: Querying for Passwords in User Scope
- Post #7: Secure Attention Key Logic in systemd-logind
- Post #8: systemd-nspawn --bind-user= Now Copies User's SSH Key
- Post #9: The New DeferReactivation= Switch in .timer Units
- Post #10: Support for the New IPE LSM
- Post #11: Environment Variables for Shell Prompt Prefix/Suffix
- Post #12: sysctl Conflict Detection via eBPF
- Post #13: initrd and µcode UKI Add-Ons
- Post #14: SecureBoot Signing with the New systemd-sbsign Tool
- Post #15: Managed Access to hidraw devices in systemd-logind
- Post #16: Fuzzy Filtering in userdbctl
- Post #17: MAC Address Based Alternative Network Interface Names
- Post #18: Conditional Copying/Symlinking in tmpfiles.d/
- Post #19: Automatic Service Restarts in Debug Mode
- Post #20: Filtering by Invocation ID in journalctl
- Post #21: Supplement Partitions in repart.d/
- Post #22: DeviceTree Matching in UKIs
- Post #23: The New ssh-exec: Protocol in varlinkctl
- Post #24: SecureBoot Key Enrollment Preparation with bootctl
- Post #25: Automatically Installing confext/sysext/portable/VMs/container Images at Boot
- Post #26: Designated Maintenance Time in systemd-logind
- Post #27: PID Namespacing in Service Management
- Post #28: Marking Experimental OS Releases in /etc/os-release
- Post #29: Decoding Capability Masks with systemd-analyze
- Post #30: Investigating Passed SMBIOS Type #11 Data
- Post #31: Initializing Partitions from Character Devices in repart.d/
- Post #32: Entering Namespaces to Generate Stacktraces
- Post #33: ID Mapped Mounts for Per-Service Directories
- Post #34: A Daemon for systemd-sysupdate
- Post #35: User Record Modifications without Administrator Consent in systemd-homed
- Post #36: DNR DHCP Support
- Post #37: Name Based AF_VSOCK ssh Access
I intend to do a similar series of serieses of posts for the next systemd release (v258), hence if you haven't left tech Twitter for Mastodon yet, now is the opportunity.
16 Dec 2024 11:00pm GMT
14 Dec 2024
planet.freedesktop.org
Simon Ser: Status update, December 2024
Hi!
For once let's open things up with the NPotM. I've started working on sajin, an Android app which synchronizes camera pictures in the background. I've grown tired of manually copying files around, and I don't want to use proprietary services to backup my pictures, so I've been meaning to write a tiny app to upload pictures to my server. It's super simple: enter the WebDAV server URL and credentials, then just forget about the app. It plays well with sogogi (my WebDAV file server) and Photoview (a Web picture gallery). I'd like to implement feedback on synchronization status and manual synchronization of older pictures. I really need to find an icon for it too.
Once again, this month I've spent a fair bit of time on Sway and wlroots bug fixes, in particular wlroots DRM backend issues affecting old GPUs (these not supporting the atomic KMS API) and multi-GPU setups (I've had to bite the bullet and bring my super shaky setup out of the closet). wlroots 0.18.2 has been released, among other things it also fixes some X11 drag-and-drop bugs (thanks Consolatis!).
In IRC land, delthas has added soju support for the metadata extension, enabling clients to mark conversations as pinned or muted. Once senpai and Goguma add support for this extension, they will be able to synchronize this bit of state. In other words, marking a conversation as pinned on a mobile phone will also affect all other connected clients.
Thanks to John Regan, PostgreSQL message queries have been optimized by several orders of magnitude: on large message stores, they now take a few milliseconds instead of multiple seconds. I've turned on WAL mode for SQLite, which should help with message insertion performance.
I've worked on making Goguma play better with direct connections to old IRC servers such as Libera Chat and OFTC. These servers support only a few IRCv3 extensions, and they aggressively rate-limit TCP connections and commands (including CAP REQ
commands sent to initialize the connection). Goguma should now reconnect less often on first setup and should connect more quickly (by reducing the amount of CAP REQ
commands).
Last, I've added proper support for GitLab Pages to dalligi, a small bridge to use builds.sr.ht as a GitLab CI runner. GitLab Pages requires to define a special job with the exact name "pages", which is cumbersome with builds.sr.ht. dalligi can now copy over artifacts of a previous job to this special "pages" job. I hope this can be used to automatically publish wlroots docs.
See you next year!
14 Dec 2024 10:00pm GMT
12 Dec 2024
planet.freedesktop.org
Hans de Goede: IPU6 camera support is broken in kernel 6.11.11 / 6.12.2-6.12.4
Unfortunately an incomplete backport of IPU6 DMA handling changes has landed in kernel 6.11.11.
This not only causes IPU6 cameras to not work, this causes the kernel to (often?) crash on boot on systems where the IPU6 is in use and thus enabled by the BIOS.
Kernels 6.12.2 - 6.12.4 are also affected by this. A fix for this is pending for the upcoming 6.12.5 release.
6.11.11 is the last stable release in the 6.11.y series, so there will be no new stable 6.11.y release with a fix.
As a workaround users affected by this can stay with 6.11.10 or 6.12.1 until 6.12.5 is available in your distributions updates(-testing) repository.
comments
12 Dec 2024 1:52pm GMT
02 Dec 2024
planet.freedesktop.org
Alyssa Rosenzweig: Vulkan 1.4 sur Asahi Linux
English version follows.
Aujourd'hui, Khronos Group a sorti la spécification 1.4 de l'API graphique standard Vulkan. Le projet Asahi Linux est fier d'annoncer le premier pilote Vulkan 1.4 pour le matériel d'Apple. En effet, notre pilote graphique Honeykrisp est reconnu par Khronos comme conforme à cette nouvelle version dès aujourd'hui.
Ce pilote est déjà disponible dans nos dépôts officiels. Après avoir installé Fedora Asahi Remix, executez dnf upgrade --refresh
pour obtenir la dernière version du pilote.
Vulkan 1.4 standardise plusieurs fonctionnalités importantes, y compris les horodatages et la lecture locale avec le rendu dynamique. L'industrie suppose que ces fonctionnalités devront être plus courantes, et nous y sommes préparés.
Sortir un pilote conforme reflète notre engagement en faveur des standards graphiques et du logiciel libre. Asahi Linux est aussi compatible avec OpenGL 4.6, OpenGL ES 3.2, et OpenCL 3.0, tous conformes aux spécifications pertinentes. D'ailleurs, les nôtres sont les seuls pilotes conformes pour le materiel d'Apple de n'importe quel standard graphique.
Même si le pilote est sorti, il faut encore compiler une version expérimentale de Vulkan-Loader pour utiliser la nouvelle version de Vulkan. Toutes les nouvelles fonctionnalités sont néanmoins disponibles comme extensions à notre pilote Vulkan 1.3 pour en profiter tout de suite.
Pour plus d'informations, consultez l'article du blog de Khronos.
Today, the Khronos Group released the 1.4 specification of Vulkan, the standard graphics API. The Asahi Linux project is proud to announce the first Vulkan 1.4 driver for Apple hardware. Our Honeykrisp driver is Khronos-recognized as conformant to the new version since day one.
That driver is already available in our official repositories. After installing Fedora Asahi Remix, run dnf upgrade --refresh
to get the latest drivers.
Vulkan 1.4 standardizes several important features, including timestamps and dynamic rendering local read. The industry expects that these features will become more common, and we are prepared.
Releasing a conformant driver reflects our commitment to graphics standards and software freedom. Asahi Linux is also compatible with OpenGL 4.6, OpenGL ES 3.2, and OpenCL 3.0, all conformant to the relevant specifications. For that matter, ours are the only conformant drivers on Apple hardware for any graphics standard.
Although the driver is released, you still need to build an experimental version of Vulkan-Loader to access the new Vulkan version. Nevertheless, you can immediately use all the new features as extensions in our Vulkan 1.3 driver.
For more information, see the Khronos blog post.
02 Dec 2024 5:00am GMT
21 Nov 2024
planet.freedesktop.org
Simon Ser: Status update, November 2024
Hi all!
This month I've spent a lot of time triaging Sway and wlroots issues following the Sway 1.10 release. There are a few regressions, some of which are already fixed (thanks to all contributors for sending patches!). Kenny has added support for software-only secondary KMS devices such as GUD and DisplayLink. David Turner from Raspberry Pi has contributed crop and scale support for output buffers, that way video players are more likely to hit direct scan-out. I've added support for explicit sync in the Wayland backend for nested compositors.
I've worked a bit on the Goguma mobile IRC client. The auto-complete dropdown now shows user display names, channel topics and command descriptions. Additionally, commands which don't make sense given the current context are hidden (for instance, /part
is not displayed in a conversation with a single user).
The gamja Web IRC client should now reconnect more quickly after regaining connectivity. For instance, after resume from suspend, gamja now reconnects immediately instead of waiting 10 seconds. Thanks to Matteo, soju-containers now ships arm64 images.
The NPotM is sogogi, a simple WebDAV file server. It's quite minimal for now: a list of directories to serve is defined in the configuration file, as well as users and access lists. In the future, I'd like to add external authentication (e.g. via PAM or via another HTTP server), HTML directory listings and configuration file reload.
That's all for now! Once again, that's a pretty short status update. A lot of my time goes into more boring maintenance tasks and reviews. See you next month!
21 Nov 2024 10:00pm GMT
19 Nov 2024
planet.freedesktop.org
Melissa Wen: Display/KMS Meeting at XDC 2024: Detailed Report
XDC 2024 in Montreal was another fantastic gathering for the Linux Graphics community. It was again a great time to immerse in the world of graphics development, engage in stimulating conversations, and learn from inspiring developers.
Many Igalia colleagues and I participated in the conference again, delivering multiple talks about our work on the Linux Graphics stack and also organizing the Display/KMS meeting. This blog post is a detailed report on the Display/KMS meeting held during this XDC edition.
Short on Time?
- Catch the lightning talk summarizing the meeting here (you can even speed up 2x):
- For a quick written summary, scroll down to the TL;DR section.
TL;DR
This meeting took 3 hours and tackled a variety of topics related to DRM/KMS (Linux/DRM Kernel Modesetting):
- Sharing Drivers Between V4L2 and KMS: Brainstorming solutions for using a single driver for devices used in both camera capture and display pipelines.
- Real-Time Scheduling: Addressing issues with non-blocking page flips encountering sigkills under real-time scheduling.
- HDR/Color Management: Agreement on merging the current proposal, with NVIDIA implementing its special cases on VKMS and adding missing parts on top of Harry Wentland's (AMD) changes.
- Display Mux: Collaborative design discussions focusing on compositor control and cross-sync considerations.
- Better Commit Failure Feedback: Exploring ways to equip compositors with more detailed information for failure analysis.
Bringing together Linux display developers in the XDC 2024
While I didn't present a talk this year, I co-organized a Display/KMS meeting (with Rodrigo Siqueira of AMD) to build upon the momentum from the 2024 Linux Display Next hackfest. The meeting was attended by around 30 people in person and 4 remote participants.
Speakers: Melissa Wen (Igalia) and Rodrigo Siqueira (AMD)
Link: https://indico.freedesktop.org/event/6/contributions/383/
Topics: Similar to the hackfest, the meeting agenda was built over the first two days of the conference and mixed talks follow-up with new ideas and ongoing community efforts.
The final agenda covered five topics in the scheduled order:
- How to share drivers between V4L2 and DRM for bridge-like components (new topic);
- Real-time Scheduling (problems encountered after the Display Next hackfest);
- HDR/Color Management (ofc);
- Display Mux (from Display hackfest and XDC 2024 talk, bringing AMD and NVIDIA together);
- (Better) Commit Failure Feedback (continuing the last minute topic of the Display Next hackfest).
Unpacking the Topics
Similar to the hackfest, the meeting agenda evolved over the conference. During the 3 hours of meeting, I coordinated the room and discussion rounds, and Rodrigo Siqueira took notes and also contacted key developers to provide a detailed report of the many topics discussed.
From his notes, let's dive into the key discussions!
How to share drivers between V4L2 and KMS for bridge-like components.
Led by Laurent Pinchart, we delved into the challenge of creating a unified driver for hardware devices (like scalers) that are used in both camera capture pipelines and display pipelines.
- Problem Statement: How can we design a single kernel driver to handle devices that serve dual purposes in both V4L2 and DRM subsystems?
- Potential Solutions:
- Multiple Compatible Strings: We could assign different compatible strings to the device tree node based on its usage in either the camera or display pipeline. However, this approach might raise concerns from device tree maintainers as it could be seen as a layer violation.
- Separate Abstractions: A single driver could expose the device to both DRM and V4L2 through separate abstractions: drm-bridge for DRM and V4L2 subdev for video. While simple, this approach requires maintaining two different abstractions for the same underlying device.
- Unified Kernel Abstraction: We could create a new, unified kernel abstraction that combines the best aspects of drm-bridge and V4L2 subdev. This approach offers a more elegant solution but requires significant design effort and potential migration challenges for existing hardware.
Real-Time Scheduling Challenges
We have discussed real-time scheduling during this year Linux Display Next hackfest and, during the XDC 2024, Jonas Adahl brought up issues uncovered while progressing on this front.
- Context: Non-blocking page-flips can, on rare occasions, take a long time and, for that reason, get a sigkill if the thread doing the atomic commit is a real-time schedule.
- Action items:
- Explore alternative backtraces during the busy wait (e.g., ftrace).
- Investigate the maximum thread time in busy wait to reproduce issues faced by compositors. Tools like RTKit (mutter) can be used for better control (Michel Dänzer can help with this setup).
HDR/Color Management
This is a well-known topic with ongoing effort on all layers of the Linux Display stack and has been discussed online and in-person in conferences and meetings over the last years.
Here's a breakdown of the key points raised at this meeting:
- Talk: Color operations for Linux color pipeline on AMD devices: In the previous day, Alex Hung (AMD) presented the implementation of this API on AMD display driver.
- NVIDIA Integration: While they agree with the overall proposal, NVIDIA needs to add some missing parts. Importantly, they will implement these on top of Harry Wentland's (AMD) proposal. Their specific requirements will be implemented on VKMS (Virtual Kernel Mode Setting driver) for further discussion. This VKMS implementation can benefit compositor developers by providing insights into NVIDIA's specific needs.
- Other vendors: There is a version of the KMS API applied on Intel color pipeline. Apart from that, other vendors appear to be comfortable with the current proposal but lacks the bandwidth to implement it right now.
- Upstream Patches: The relevant upstream patches were can be found here. [As humorously notes, this series is eagerly awaiting your "Acked-by" (approval)]
- Compositor Side: The compositor developers have also made significant progress.
- KDE has already implemented and validated the API through an experimental implementation in Kwin.
- Gamescope currently uses a driver-specific implementation but has a draft that utilizes the generic version. However, some work is still required to fully transition away from the driver-specific approach. AP: work on porting gamescope to KMS generic API
- Weston has also begun exploring implementation, and we might see something from them by the end of the year.
- Kernel and Testing: The kernel API proposal is well-refined and meets the DRM subsystem requirements. Thanks to Harry Wentland effort, we already have the API attached to two hardware vendors and IGT tests, and, thanks to Xaver Hugl, a compositor implementation in place.
Finally, there was a strong sense of agreement that the current proposal for HDR/Color Management is ready to be merged. In simpler terms, everything seems to be working well on the technical side - all signs point to merging and "shipping" the DRM/KMS plane color management API!
Display Mux
During the meeting, Daniel Dadap led a brainstorming session on the design of the display mux switching sequence, in which the compositor would arm the switch via sysfs, then send a modeset to the outgoing driver, followed by a modeset to the incoming driver.
- Context:
- During this year Linux Display Next hackfest, Mario Limonciello (AMD) introduced the topic and led a discussion on Display Mux.
- Daniel Dadap (NVIDIA) retook this discussion with the XDC 2024 talk: Dynamic Switching of Display Muxes on Hybrid GPU Systems.
- Key Considerations:
- HPD Handling: There was a general consensus that disabling HPD can be part of the sequence for internal panels and we don't need to focus on it here.
- Cross-Sync: Ensuring synchronization between the compositor and the drivers is crucial. The compositor should act as the "drm-master" to coordinate the entire sequence, but how can this be ensured?
- Future-Proofing: The design should not assume the presence of a mux. In future scenarios, direct sharing over DP might be possible.
- Action points:
- Sharing DP AUX: Explore the idea of sharing DP AUX and its implications.
- Backlight: The backlight definition represents a problem in the mux switch context, so we should explore some of the current specs available for that.
Towards Better Commit Failure Feedback
In the last part of the meeting, Xaver Hugl asked for better commit failure feedback.
- Problem description: Compositors currently face challenges in collecting detailed information from the kernel about commit failures. This lack of granular data hinders their ability to understand and address the root causes of these failures.
To address this issue, we discussed several potential improvements:
- Direct Kernel Log Access: One idea is to directly load relevant kernel logs into the compositor. This would provide more detailed information about the failure and potentially aid in debugging.
- Finer-Grained Failure Reporting: We also explored the possibility of separating atomic failures into more specific categories. Not all failures are critical, and understanding the nature of the failure can help compositors take appropriate action.
- Enhanced Logging: Currently, the dmesg log doesn't provide enough information for user-space validation. Raising the log level to capture more detailed information during failures could be a viable solution.
By implementing these improvements, we aim to equip compositors with the necessary tools to better understand and resolve commit failures, leading to a more robust and stable display system.
A Big Thank You!
Huge thanks to Rodrigo Siqueira for these detailed meeting notes. Also, Laurent Pinchart, Jonas Adahl, Daniel Dadap, Xaver Hugl, and Harry Wentland for bringing up interesting topics and leading discussions. Finally, thanks to all the participants who enriched the discussions with their experience, ideas, and inputs, especially Alex Goins, Antonino Maniscalco, Austin Shafer, Daniel Stone, Demi Obenour, Jessica Zhang, Joan Torres, Leo Li, Liviu Dudau, Mario Limonciello, Michel Dänzer, Rob Clark, Simon Ser and Teddy Li.
This collaborative effort will undoubtedly contribute to the continued development of the Linux display stack.
Stay tuned for future updates!
19 Nov 2024 1:00pm GMT