LWN.net Weekly Edition for March 16, 2017
Notes from Linaro Connect
The first of two 2017 Linaro Connect events was held March 6 to 10 in Budapest, Hungary; your editor had the privilege of attending. Reports from a number of the sessions there have appeared in separate articles. There were a number of discussions at the event that, while not being enough to fill an article on their own, were nevertheless worthy of some attention.Connect is an interesting event, in that it is a combination of an architecture-specific kernel developers' gathering and a members-only meeting session. Not being a member, your editor only participated in the former aspect. Sessions at Connect are usually short — 25 minutes — and focused on a specific topic; they also routinely run over their allotted time. There is an emphasis on discussion, especially in the relatively unstructured "hack sessions" that occupy much of the schedule. Many of the sessions are focused on training: how to upstream code, for example, or kernel debugging stories in Mandarin (video).
A lack of Mandarin language skills will prevent coverage of that last session, but there were others that were somewhat more comprehensible to the Mandarin-impaired.
Kernelci.org
Mark Brown, Tyler Baker, and Matt Hart ran a session about kernelci.org, arguably one of the community's most underappreciated testing resources. This operation, run by Linaro and BayLibre, performs automatic build-and-boot testing for the kernel; its infrastructure is hosted by Linaro and Collabora. Tests are run on the ARM, ARM64, MIPS, and x86 architectures. For every commit that is made, tests are run with every in-tree defconfig file — over 260 builds for every commit. The resulting kernels are booted on over 100 different boards. This operation, Brown said, greatly increases the likelihood that kernels will build and, as a result, the number of failed configurations is going down over time. That, in turn, makes merge windows less stressful.
As Baker explained, this testing structure is driven by the LAVA tool; it serves as a scheduler and job runner for board farms. LAVA is used and distributed by Debian, he said.
LAVA is completing a big transition to the v2 release, which makes a number of significant changes, Hart said. Job files are now created with Jinja2 templates, an improvement over the hand-written JSON used in v1. Jobs are run asynchronously, without polling, and ZeroMQ is used for communications. ReactOBus is used to run jobs from messages. LAVA v1 tried to apply a fair amount of magic to hide the differences between different test systems, but that proved hard to work with. So v2 requires more explicit configuration in this area.
The v2 system is settling in, but a permanent home for the ReactOBus daemon is yet to be identified. [Video]
Load tracking
Vincent Guittot ran a session on load tracking — keeping track of how much load each process puts on the CPU. Accurate load tracking can help the scheduler make better decisions about task placement in the system; it can also be helpful when trying to minimize the system's power consumption. The per-entity load tracking (PELT) mechanism in the kernel is better than what came before, but it is proving to not work as well as desired, especially when it comes to power management. The window-assisted load tracking (WALT) patches (described in this article) improve the situation, but that work has not made it into the mainline.
The complaints with PELT are that it is not responsive enough and that its metrics are not always stable. The tracking of small tasks can be inaccurate, causing a mostly idle CPU to appear to be busy. Load is not propagated between control groups when a task is migrated which, among other things, can cause erroneous CPU-frequency changes. The good news is that around 20 patches improving PELT have been merged since 4.7; they fix the small-task tracking and load-propagation issues. Upcoming work should improve the handling of blocked loads and address some of the frequency scaling issues.
A related problem is that the community has lacked realistic benchmarks to measure the results of load-tracking changes; that is being addressed with new tests. There are some interesting interactions with the processor's thermal management mechanisms, though. When asked, Guittot said that there has not been a lot of power-consumption testing so far; most of the work to this point has been focused on performance.
Future work includes improving utilization tracking for realtime tasks, which are currently not part of the load-tracking mechanism. There are also some practical problems on current hardware. Realtime tasks want to run at the maximum frequency, but a frequency change on a HiKey board takes 1.5ms. A realtime task needing 2ms of run time will not get maximum-frequency performance. A more responsive load-tracking mechanism could help the scheduler ensure that the CPU is running at the needed speed. There is also a focus on improving responsiveness, which comes down to ensuring that the CPU frequency is increased quickly when the need arises. A slow ramp-up will lead to observable behaviors like jumpy scrolling. Finally, there is a desire to improve the responsiveness of the PELT system, perhaps by introducing the windowing technique used in WALT. [Slides]
ARM Mali drivers
Many ARM systems come equipped with the ARM Mali GPU. In a session on the state of the Mali drivers, John Reitan and Ketil Johnsen described some of the work that is being done in this area. There is a software development kit for the Vulkan graphics API available under the BSD license. Not all GPUs support Vulkan, though; in particular, the HiKey board used by many ARM developers has no Vulkan support. Within a month or so ARM should be releasing its compute library that allows running code on the GPU. It may be useful for image-recognition tasks and more. It will show up on the ARM GitHub page once it's ready.
With the news items out of the way, the audience quickly moved the discussion to the topic its members were really interested in: prospects for open-sourcing the Mali driver code. The answer was that ARM has no intention of doing so, mostly out of fear of unspecified "patent issues". The risk of patent trolls is simply too great to allow that release to happen. This was not, of course, the answer that the audience wanted to hear, but nobody was particularly surprised.
Arnd Bergmann suggested that perhaps a free Vulkan driver could be released; Vulkan is simpler than the full OpenGL API and might thus pose a lower risk. The speakers are not lawyers and could not respond to that suggestion beyond agreeing that it is worth considering. Meanwhile, there is a possibility that free drivers for some subcomponents could be released in the relatively near future.
A related pain point around Mali is the lack of device-tree bindings in the kernel. The normal rule is that bindings are only accepted for drivers that are, themselves, in the kernel; there is no Mali driver there, thus no bindings. But that has led every SoC vendor to come up with its own customized bindings. There has been talk of loosening the rules a bit to allow the addition of bindings for some out-of-tree drivers to reduce this pain.
John Stultz pointed out that running the Mali drivers on mainline kernels is often difficult, and wondered if there were any improvements expected in that area. Development effort on the binary-only driver tends to be focused on kernels the customers are using, and those kernels are usually old. Internally, the Mali driver does usually work on the mainline, but it can take months for the patches to get out to the rest of the world.
It's also hard for distributors who would like to make the binary-only driver available to their users. One recent improvement, at least, is that the license on that driver has changed to allow it to be distributed. But it is still difficult to make a package that works on even a subset of boards. Meanwhile, every driver release tends to break systems, and the driver tends to break with kernel updates. As Grant Likely pointed out, having to keep the kernel and the user-space driver code in lockstep makes the creation of any sort of generic distribution difficult. It was agreed that a better job needs to be done here. [Video]
For those interested in other Connect sessions, the full set of videos and slides from the "BUD17" event can be found on this page. The next Connect will be held September 25 to 29 in San Francisco, California.
[Thanks to Linaro and the Linux Foundation for funding your editor's travel to Connect.]
2038: only 21 years away
Sometimes it seems that things have gone relatively quiet on the year-2038 front. But time keeps moving forward, and the point in early 2038 when 32-bit time_t values can no longer represent times correctly is now less than 21 years away. That may seem like a long time, but the relatively long life cycle of many embedded systems means that some systems deployed today will still be in service when that deadline hits. One of the developers leading the effort to address this problem is Arnd Bergmann; at Linaro Connect 2017 he gave an update on where that work stands.That work, he said, is proceeding on three separate fronts, the first of which is the kernel itself. He has been working for the last five years to try to prepare the kernel for 2038. Much of that work involves converting 32-bit timestamps to 64-bit values, even on 32-bit systems. Some 32-bit timestamps also show up in the user-space API, which complicates the issue considerably. There is a plan for the enhancement of the user-space API with 2038-clean versions of the problematic system calls, but it has not yet gotten upstream. One recent exception is the statx() system call, which was merged for 4.11; statx() will serve as the year-2038-capable version of the stat() family of calls. There are quite a few other system calls still needing 2038-clean replacements, though.
There is one other person, Deepa Dinamani, working on the kernel side of
things; she started as an Outreachy intern and has
continued to work on the
problem after the internship ended. Dinamani has a set of virtual
filesystem layer patches in hand, which address one of the hardest
problems, and she has plans for some other system calls as well. One of
the trickier ones might be setsockopt(), which isn't easily
fixed or emulated at the glibc level. There are device-mapper and input
subsystem patches in an advanced state. Bergmann had a patch for the
video4linux subsystem, but that was rejected and needs a new approach; a
similar situation exists for the audio subsystem. Other areas needing work
in the kernel are key management and realtime clocks.
For some system calls, there will be no replacement, since the best approach appears to be emulation in the C libraries — the second focus for the year-2038 effort. There has been a lot of work done in the glibc community in particular, he said; the plan is to be fully backward compatible at that level. That means that it will be possible to build a program with either 32-bit or 64-bit timestamps, and to use the larger timestamps even on older kernels. In other words, the glibc developers are trying to make things work everywhere, with a minimum of disruption. (See this draft design document for lots of details on the glibc plan.)
The third focus is on distribution builds, which can only really proceed once the first two pieces are in place. Most distributors, Bergmann said, are unlikely to even bother with 32-bit systems in 2038, so they won't have much to worry about. One big exception may be Debian, which seems interested in maintaining support, even though it looks like it will be a painful task. It may require a full rebuild at some point, which isn't much fun for anybody involved, but it is at least a process that is known to work. Compatibility is key in such a system; there is code being deployed now that may not be 2038-clean, but people want it to keep working if at all possible.
One big area of concern is automobiles. A lot of devices, such as handsets, will have long since failed for any of a number of other reasons by then, so there is little point in ensuring that they can survive 2038. But people keep cars going for a long time. There may still be cameras in use by then, and there is highly likely to be a lot of deeply embedded systems such as building infrastructure. Some of these systems are going to fail in 2038. That is why it is important to get the problem fixed as soon as possible.
There are some things that are going to be difficult to fix, though, even when the kernel, C libraries, and distributions are mostly taken care of; many of these are the result of the use of 32-bit time_t values in file formats. Thus, for example, cpio will fail, which is problematic because it is used by the RPM package format. The NFSv3, ext3, and XFS filesystems all have problems resulting from their use of 32-bit timestamps. The first two are likely to have gone out of use long before the problem hits, and plans for the repair of XFS are in the works. Then, of course, there is a whole list of applications that nobody has yet noticed are broken, and lots of in-house applications that cannot be fixed by the community.
When asked which tools he is using for this work, Bergmann replied that his core technique involves building kernels with the 32-bit time types removed completely. That will quickly point out the places that still need to be fixed. Beyond that, he said, it's mostly a manual process. It was suggested that sparse or GCC plugins could maybe help with this task.
As things wound down, John Stultz asked how much the work in the BSD camp, which has (in some variants) already solved its year-2038 problems, might help with Linux. The answer would appear to be "not much". BSD-based distributions have the advantage of being able to rebuild everything from scratch, so they do not need to maintain user-space ABI compatibility in the same way. There is some value in in the work that has been done to fix applications with year-2038 problems, but it's not clear how much that will help the Linux community.
[Thanks to Linaro and the Linux Foundation for funding your editor's travel to Connect.]
Security
A kernel TEE party
The operating system kernel is normally thought of as having power over the entire system, but there are reasons, both good and bad, for wanting to isolate some functionality even from the kernel. One example is the trusted platform module (TPM) found on many x86 systems; it can provide various cryptographic services to the kernel, but its internals are not accessible to kernel code. In the ARM world, this kind of functionality is often provided via the TrustZone mechanism, but the kernel has no standardized way of working with TrustZone code. The generic TEE subsystem patches from Jens Wiklander aim to change that state of affairs.A processor with TrustZone support can run in two modes, often termed the secure and non-secure worlds. The secure world can be given exclusive access to memory, devices, and more; those resources are inaccessible when running in the non-secure mode. A hardware trap mechanism is used to transition between the two worlds. The secure-world code, thus, looks a lot like an innermost kernel, protected from the Linux kernel, that has a limited set of security-relevant tasks to perform.
The secure world gains control first at boot time, allowing it to set up access to the rest of its resources and configure the environment for the non-secure kernel. This would also be the time to implement a secure-boot mechanism, if desired, ensuring that the non-secure kernel carries an acceptable signature. A number of functions can be implemented in the secure-world code. For example, cryptographic keys can be stored there, inaccessible to the rest of the system, but usable by the secure world to generate signatures. Naturally, there is interest in using the secure world to implement digital rights management mechanisms and other unpleasant things. Like most of these technologies, TrustZone can be used to ensure a user's control over their computer or to take it away.
The code running in the secure world is often called the "trusted execution environment", or TEE (as opposed to the non-secure "rich execution environment" or REE). As befits the ARM world, there are a lot of TEEs out there, each with its own interface to the kernel. The purpose of the generic TEE subsystem is to settle on one kernel-side interface for TEEs, with a standard communication mechanism for talking to them. To that end, it creates two sets of devices: /dev/teeN, and /dev/teeprivN. The former set allows user space to make requests of the TEE, while the latter is there for "supplicant" processes that provide services to the TEE.
A process needing a TEE service opens the appropriate device, then issues a series of ioctl() calls. The available commands include TEE_IOC_SHM_ALLOC to allocate a range of memory shared between the process and the TEE, TEE_IOC_INVOKE to call a function inside the TEE, and more. For each call, the TEE generates some sort of results which are passed back to the calling process. For the /dev/teepriv interfaces, the calls go the other way; when the TEE needs a user-space service (the contents of a file on disk, say), it will send a request to the waiting supplicant process via this interface.
The generic TEE code is, for the most part, a wrapper layer that turns user-space ioctl() calls into calls to the low-level driver. That driver will have registered itself, providing a tee_driver_ops structure with its operations. The biggest exception relates to the handling of shared-memory segments, which involves a certain amount of complexity. There is a fairly elaborate reference-counting mechanism that, for example, tracks the references created by every parameter passed into a TEE operation; that ensures that the memory is not freed while references still exist.
The low-level driver code is charged with communicating between the generic TEE layer and the actual TEE implementation. Much of this code is concerned with formatting requests as expected by the TEE and low-level communications. Shared memory is also an issue at this level, since mapping memory that the TEE can access requires cooperation with the TEE itself.
The generic TEE subsystem patches come with a driver for one TEE, an open-source implementation called OP-TEE. This system, developed by STMicroelectronics and Linaro, provides a simple operating-system kernel meant to run in the secure world. OP-TEE is meant to be the substrate on which TEEs are created; those wanting to learn more can have a look at this design document. There is also an OP-TEE "hello world" application giving an idea of what secure-world code looks like.
All of this structure is intended to build things like the OP-TEE secure data path (recently presented at Linaro Connect), the purpose of which is to enable Android devices to play protected content without letting the end users actually get their hands on it. But a free TEE environment should also make it easy to develop less user-hostile secure services as free software. Once the generic TEE patches are merged (something that seems like it should happen sometime this year), we'll have a standard interface for providing and using such services.
Brief items
Security quotes of the week
This bill should -- if there's any amount of brain activity in the NY legislature -- die a swift and unceremonious death. But nothing this bad stays dead forever. It will return in some other shape or form months or years later because some people truly believe information doesn't want to be free -- it wants to be forgotten.
Critical vulnerability under “massive” attack imperils high-impact sites (Ars Technica)
Ars Technica is reporting that a recently patched vulnerability in the Apache Struts 2 web framework is being actively exploited in the wild. "It's not clear why the vulnerability is being exploited so widely 48 hours after a patch was released. One possibility is that the Apache Struts maintainers didn't adequately communicate the risk. Although they categorize the vulnerability security rating as high, they also describe it as posing a 'possible remote code execution' risk. Outside researchers, meanwhile, have said the exploits are trivial to carry out, are highly reliable, and require no authentication. It's also easy to scan the Internet for vulnerable servers. It's also possible to exploit the bug even if a Web application doesn't implement file upload functionality."
Security updates
Alert summary March 9, 2017 to March 15, 2017
Dist. | ID | Release | Package | Date |
---|---|---|---|---|
Arch Linux | ASA-201703-4 | chromium | 2017-03-11 | |
Arch Linux | ASA-201703-3 | firefox | 2017-03-10 | |
Arch Linux | ASA-201703-11 | flashplugin | 2017-03-15 | |
Arch Linux | ASA-201703-9 | jasper | 2017-03-14 | |
Arch Linux | ASA-201703-8 | kernel | 2017-03-14 | |
Arch Linux | ASA-201703-12 | lib32-flashplugin | 2017-03-15 | |
Arch Linux | ASA-201703-5 | libxslt | 2017-03-12 | |
Arch Linux | ASA-201703-7 | linux-grsec | 2017-03-13 | |
Arch Linux | ASA-201703-6 | linux-lts | 2017-03-13 | |
Arch Linux | ASA-201703-10 | roundcubemail | 2017-03-14 | |
Arch Linux | ASA-201703-2 | thunderbird | 2017-03-10 | |
CentOS | CESA-2017:0459 | C5 | firefox | 2017-03-08 |
CentOS | CESA-2017:0459 | C6 | firefox | 2017-03-08 |
CentOS | CESA-2017:0461 | C7 | firefox | 2017-03-08 |
CentOS | CESA-2017:0454 | C5 | kvm | 2017-03-08 |
Debian | DSA-3810-1 | stable | chromium-browser | 2017-03-15 |
Debian | DLA-852-1 | LTS | firefox-esr | 2017-03-10 |
Debian | DSA-3805-1 | stable | firefox-esr | 2017-03-09 |
Debian | DLA-854-1 | LTS | icoutils | 2017-03-13 |
Debian | DSA-3807-1 | stable | icoutils | 2017-03-12 |
Debian | DSA-3808-1 | stable | imagemagick | 2017-03-13 |
Debian | DLA-849-1 | LTS | kernel | 2017-03-09 |
Debian | DSA-3804-1 | stable | kernel | 2017-03-08 |
Debian | DSA-3809-1 | stable | mariadb-10.0 | 2017-03-14 |
Debian | DLA-853-1 | LTS | pidgin | 2017-03-11 |
Debian | DSA-3806-1 | stable | pidgin | 2017-03-10 |
Debian | DLA-855-1 | LTS | roundcube | 2017-03-13 |
Debian | DLA-850-1 | LTS | vim | 2017-03-09 |
Debian | DLA-851-1 | LTS | wget | 2017-03-09 |
Fedora | FEDORA-2017-d2bab54ac9 | F24 | GraphicsMagick | 2017-03-11 |
Fedora | FEDORA-2017-c71a0f40f0 | F25 | GraphicsMagick | 2017-03-09 |
Fedora | FEDORA-2017-bcab179007 | F24 | drupal7-views | 2017-03-09 |
Fedora | FEDORA-2017-82ce4661d6 | F25 | drupal7-views | 2017-03-09 |
Fedora | FEDORA-2017-06365bdcfd | F25 | ettercap | 2017-03-14 |
Fedora | FEDORA-2017-f3484d64d2 | F24 | firefox | 2017-03-10 |
Fedora | FEDORA-2017-bb459964ce | F25 | firefox | 2017-03-09 |
Fedora | FEDORA-2017-3886afeb06 | F24 | freetype | 2017-03-13 |
Fedora | FEDORA-2017-c09c0cc384 | F25 | freetype | 2017-03-12 |
Fedora | FEDORA-2017-b011e8c922 | F24 | kdelibs | 2017-03-11 |
Fedora | FEDORA-2017-01eed6fe8c | F24 | kdelibs3 | 2017-03-12 |
Fedora | FEDORA-2017-4f4eef4791 | F25 | kdelibs3 | 2017-03-12 |
Fedora | FEDORA-2017-2e1f3694b2 | F24 | kernel | 2017-03-11 |
Fedora | FEDORA-2017-387ff46a66 | F25 | kernel | 2017-03-11 |
Fedora | FEDORA-2017-038e821698 | F25 | knot | 2017-03-09 |
Fedora | FEDORA-2017-038e821698 | F25 | knot-resolver | 2017-03-09 |
Fedora | FEDORA-2017-3bd0b2e2c0 | F24 | libupnp | 2017-03-13 |
Fedora | FEDORA-2017-2c29702300 | F25 | libupnp | 2017-03-10 |
Fedora | FEDORA-2017-9a5b89363f | F24 | libwmf | 2017-03-13 |
Fedora | FEDORA-2017-25df1dbd02 | F24 | munin | 2017-03-10 |
Fedora | FEDORA-2017-3776c9d747 | F25 | munin | 2017-03-10 |
Fedora | FEDORA-2017-aaf92c483c | F24 | php-pear-PHP-CodeSniffer | 2017-03-10 |
Fedora | FEDORA-2017-ca3f01bd37 | F25 | php-pear-PHP-CodeSniffer | 2017-03-10 |
Fedora | FEDORA-2017-e63f2f0d11 | F24 | thunderbird | 2017-03-13 |
Fedora | FEDORA-2017-fce0c6fd46 | F25 | thunderbird | 2017-03-12 |
Fedora | FEDORA-2017-5b32a5782b | F24 | tor | 2017-03-13 |
Fedora | FEDORA-2017-6f3ea63acc | F25 | tor | 2017-03-14 |
Fedora | FEDORA-2017-2e6b693937 | F25 | w3m | 2017-03-14 |
Fedora | FEDORA-2017-6c91c98b33 | F25 | wireshark | 2017-03-12 |
Mageia | MGASA-2017-0074 | 5 | flac | 2017-03-12 |
Mageia | MGASA-2017-0075 | 5 | flash-player-plugin | 2017-03-12 |
Mageia | MGASA-2017-0073 | 5 | potrace | 2017-03-12 |
Mageia | MGASA-2017-0076 | 5 | wireshark | 2017-03-12 |
openSUSE | openSUSE-SU-2017:0664-1 | 42.2 | Wireshark | 2017-03-11 |
openSUSE | openSUSE-SU-2017:0669-1 | 42.1 42.2 | bitlbee | 2017-03-11 |
openSUSE | openSUSE-SU-2017:0663-1 | 42.1 42.2 | cacti | 2017-03-11 |
openSUSE | openSUSE-SU-2017:0690-1 | 42.1 42.2 | firefox, mozilla-nss | 2017-03-14 |
openSUSE | openSUSE-SU-2017:0677-1 | kdelibs4, kio | 2017-03-13 | |
openSUSE | openSUSE-SU-2017:0680-1 | 42.1 42.2 | kdelibs4, kio | 2017-03-13 |
openSUSE | openSUSE-SU-2017:0668-1 | 42.1 42.2 | lynx | 2017-03-11 |
openSUSE | openSUSE-SU-2017:0674-1 | 42.1 | openssh | 2017-03-13 |
openSUSE | openSUSE-SU-2017:0678-1 | 42.1 42.2 | pax-utils | 2017-03-13 |
openSUSE | openSUSE-SU-2017:0667-1 | 42.1 42.2 | perl-Image-Info | 2017-03-11 |
openSUSE | openSUSE-SU-2017:0648-1 | 42.1 42.2 | potrace | 2017-03-10 |
openSUSE | openSUSE-SU-2017:0649-1 | 42.1 | sane-backends | 2017-03-10 |
openSUSE | openSUSE-SU-2017:0688-1 | thunderbird | 2017-03-14 | |
openSUSE | openSUSE-SU-2017:0687-1 | 42.1 42.2 | thunderbird | 2017-03-14 |
openSUSE | openSUSE-SU-2017:0665-1 | 42.2 | xen | 2017-03-11 |
Oracle | ELSA-2017-0459 | OL5 | firefox | 2017-03-08 |
Oracle | ELSA-2017-0459 | OL6 | firefox | 2017-03-08 |
Oracle | ELSA-2017-0461 | OL7 | firefox | 2017-03-08 |
Oracle | ELSA-2017-0498 | OL6 | thunderbird | 2017-03-14 |
Oracle | ELSA-2017-0498 | OL7 | thunderbird | 2017-03-14 |
Red Hat | RHSA-2017:0499-01 | EL6 | chromium-browser | 2017-03-14 |
Red Hat | RHSA-2017:0459-01 | EL5 EL6 | firefox | 2017-03-08 |
Red Hat | RHSA-2017:0461-01 | EL7 | firefox | 2017-03-08 |
Red Hat | RHSA-2017:0526-01 | EL6 | flash-plugin | 2017-03-15 |
Red Hat | RHSA-2017:0501-01 | EL7.2 | kernel | 2017-03-14 |
Red Hat | RHSA-2017:0536-01 | EL7.1 | policycoreutils | 2017-03-15 |
Red Hat | RHSA-2017:0535-01 | EL7.2 | policycoreutils | 2017-03-15 |
Red Hat | RHSA-2017:0532-01 | OSP5.0/EL7 | rabbitmq-server | 2017-03-15 |
Red Hat | RHSA-2017:0531-01 | OSP6.0/EL7 | rabbitmq-server | 2017-03-15 |
Red Hat | RHSA-2017:0530-01 | OSP7.0/EL7 | rabbitmq-server | 2017-03-15 |
Red Hat | RHSA-2017:0498-01 | EL5 EL6 EL7 | thunderbird | 2017-03-14 |
Red Hat | RHSA-2017:0527-01 | EL6 | tomcat6 | 2017-03-15 |
Scientific Linux | SLSA-2017:0459-1 | SL5 SL6 | firefox | 2017-03-08 |
Scientific Linux | SLSA-2017:0461-1 | SL7 | firefox | 2017-03-08 |
Scientific Linux | SLSA-2017:0498-1 | SL5 SL6 SL7 | thunderbird | 2017-03-14 |
Scientific Linux | SLSA-2017:0527-1 | SL6 | tomcat6 | 2017-03-15 |
SUSE | SUSE-SU-2017:0661-1 | SLE12 | qemu | 2017-03-10 |
SUSE | SUSE-SU-2017:0647-1 | SLE11 | xen | 2017-03-10 |
Ubuntu | USN-3226-1 | 12.04 | icoutils | 2017-03-13 |
Ubuntu | USN-3227-1 | 12.04 14.04 16.04 16.10 | icu | 2017-03-13 |
Ubuntu | USN-3232-1 | 12.04 14.04 16.04 16.10 | imagemagick | 2017-03-14 |
Ubuntu | USN-3223-1 | 12.04 14.04 | kde4libs | 2017-03-09 |
Ubuntu | USN-3225-1 | 12.04 14.04 16.04 16.10 | libarchive | 2017-03-09 |
Ubuntu | USN-3228-1 | 12.04 14.04 16.04 16.10 | libevent | 2017-03-13 |
Ubuntu | USN-3220-3 | 16.04 | linux-aws | 2017-03-08 |
Ubuntu | USN-3224-1 | 14.04 16.04 16.10 | lxc | 2017-03-09 |
Ubuntu | USN-3231-1 | 12.04 14.04 | pidgin | 2017-03-14 |
Ubuntu | USN-3230-1 | 14.04 16.04 16.10 | pillow | 2017-03-13 |
Ubuntu | USN-3229-1 | 12.04 | python-imaging | 2017-03-13 |
Page editor: Jake Edge
Kernel development
Brief items
Kernel release status
The current development kernel is 4.11-rc2, released on March 12. Linus said: "I think we're in fine shape for this stage in the development kernel, it shouldn't be particularly scary to just say 'I'll be a bit adventurous and test an rc2 kernel'. Yes, it's early rc time still, but go on, help us make sure we're doing ok."
The March 14 4.11 regression report shows nine known problems.
Stable updates: 4.10.2, 4.9.14, and 4.4.53 were released on March 12, followed by 4.10.3, 4.9.15, and 4.4.54 on March 15.
Quotes of the week
Kernel podcast
The March 13 kernel podcast from Jon Masters is out. "In this week’s kernel podcast: Linus Torvalds announces Linux 4.11-rc2 (including pre-enablement for Intel 5-level paging), VMA based swap readahead, and ongoing development ahead of the next cycle."
Kernel development news
Five-level page tables
Near the beginning of 2005, the merging of the four-level page tables patches for 2.6.10 was an early test of the (then) new kernel development model. It demonstrated that the community could indeed merge fundamental changes and get them out quickly to users — a far cry from the multi-year release cycles that prevailed before the 2.6.0 release. The merging of five-level page tables (outside of the merge window) for 4.11-rc2, instead, barely raised an eyebrow. It is, however, a significant change that is indicative of where the computing industry is going.A page table, of course, maps a virtual memory address to the physical address where the data is actually stored. It is conceptually a linear array indexed by the virtual address (or, at least, by the page-frame-number portion of that address) and yielding the page-frame number of the associated physical page. Such an array would be large, though, and it would be hugely wasteful. Most processes don't use the full available virtual address space even on 32-bit systems, and they don't use even a tiny fraction of it on 64-bit systems, so the address space tends to be sparsely populated and, as a result, much of that array would go unused.
The solution to this problem, as implemented in the hardware for decades, is to turn the linear array into a sparse tree representing the address space. The result is something that looks like this:
The row of boxes across the top represents the bits of a 64-bit virtual address. To translate that address, the hardware splits the address into several bit fields. Note that, in the scheme shown here (corresponding to how the x86-64 architecture uses addresses), the uppermost 16 bits are discarded; only the lower 48 bits of the virtual address are used. Of the bits that are used, the nine most significant (bits 39-47) are used to index into the page global directory (PGD); a single page for each address space. The value read there is the address of the page upper directory (PUD); bits 30-38 of the virtual address are used to index into the indicated PUD page to get the address of the page middle directory (PMD). With bits 21-29, the PMD can be indexed to get the lowest level page table, just called the PTE. Finally, bits 12-20 of the virtual address will, when used to index into the PTE, yield the physical address of the actual page containing the data. The lowest twelve bits of the virtual address are the offset into the page itself.
At any level of the page table, the pointer to the next level can be null, indicating that there are no valid virtual addresses in that range. This scheme thus allows large subtrees to be missing, corresponding to ranges of the address space that have no mapping. The middle levels can also have special entries indicating that they point directly to a (large) physical page rather than to a lower-level page table; that is how huge pages are implemented. A 2MB huge page would be found directly at the PMD level, with no intervening PTE page, for example.
One can quickly see that the process of translating a virtual address is going to be expensive, requiring several fetches from main memory. That is why the translation lookaside buffer (TLB) is so important for the performance of the system as a whole, and why huge pages, which require fewer lookups, also help.
It is worth noting that not all systems run with four levels of page tables. 32-Bit systems use three or even two levels, for example. The memory-management code is written as if all four levels were always present; some careful coding ensures that, in kernels configured to use fewer levels, the code managing the unused levels is transparently left out.
Back when four-level page tables were merged, your editor wrote: "Now
x86-64 users can have a virtual address space covering 128TB of memory,
which really should last them for a little while.
" The value of "a
little while" can now be quantified: it would appear to be about
12 years. Though, in truth, the real constraint appears to be the
64TB of physical memory that current x86-64 processors can address; as
Kirill Shutemov noted in the x86 five-level
page-table patches, there are already vendors shipping systems with
that much memory installed.
As is so often the case in this field, the solution is to add another level of indirection in the form of a fifth level of page tables. The new level, called the "P4D", is inserted between the PGD and the PUD. The patches adding this level were merged for 4.11-rc2, even though there is, at this point, no support for five-level paging on any hardware. While the addition of four-level page tables caused a bit of nervousness, the five-level patches merged were described as "low risk". At this point, the memory-management developers have a pretty good handle on the changes that need to be made to add another level.
The patches adding five-level support for upcoming Intel processors is
currently slated for 4.12. Systems running with five-level paging will
support 52-bit physical addresses and 57-bit virtual addresses. Or, as
Shutemov put it: "It bumps the limits to 128 PiB of virtual address
space and 4 PiB of physical address space. This 'ought to be enough for
anybody'.
" The new level also allows the creation of 512GB huge
pages.
The current patches have a couple of loose ends to take care of. One of those is that Xen will not work on systems with five-level page tables enabled; it will continue to work on four-level systems. There is also a need for a boot-time flag to allow switching between four-level and five-level paging so that distributors don't have to ship two different kernel binaries.
Another interesting problem is described at the end of the patch series. It would appear that there are programs out there that "know" that only the bottom 48 bits of a virtual address are valid. They take advantage of that knowledge by encoding other information in the uppermost bits. Those programs will clearly break if those bits suddenly become part of the address itself. To avoid such problems, the x86 patches in their current form will not allocate memory in the new address space by default. An application that needs that much memory, and which does not play games with virtual addresses, can provide an address hint above the boundary in a call to mmap(), at which point the kernel will understand that mappings in the upper range are accessible.
Anybody wanting to play with the new mode can do so now with QEMU, which understands five-level page tables. Otherwise it will be a matter of waiting for the processors to come out — and the funds to buy a machine with that much memory in it. When the hardware is available, the kernel should be ready for it.
A deadline scheduler update
The deadline CPU scheduler has come a long way, Juri Lelli said in his 2017 Linaro Connect session, but there is still quite a bit of work to be done. While this scheduler was originally intended for realtime workloads, there is reason to believe that it is well suited for other settings, including the embedded and mobile world. In this talk, he gave a summary of what the deadline scheduler provides now and the changes that are envisioned for the near (and not-so-near) future.The deadline scheduler was merged in the 3.14 development cycle. It adds a realtime scheduling policy that, in many ways, is more powerful than traditional, priority-based scheduling. It allows for the specification of explicit latency constraints and avoids starvation of processes by design. The scheduler has better information about the constraints of the workload it is running and can thus make better decisions.
The kernel's scheduler is based on the earliest deadline first (EDF) algorithm, under which the process with the first-expiring deadline is the one that is chosen to run. EDF is enhanced with the constant bandwidth server (CBS) algorithm (described in detail in this article), which prevents a process that is unable to run for much of its period from interfering with others. Essentially, CBS says that a deadline process must use its CPU-time reservation over the course of its scheduling period, rather than procrastinating and expecting the full reservation to be available right before the deadline. The result is a scheduler that provides strong temporal isolation for tasks, where no process can prevent another from satisfying its deadlines.
At the moment, the mobile and embedded development community is putting a lot of effort into energy-aware scheduling. This work has a valuable goal — making scheduling decisions that minimize a system's energy use — but it has proved to be hard to get upstream, though it has been merged into the Android common kernel. For many workloads, it may be that deadline scheduling is a better fit for energy-conscious workloads in the end, Lelli said
A new feature under development is bandwidth reclaiming. One of the core
features of deadline scheduling is that, when a process exceeds its
CPU-time reservation (its CPU "bandwidth"), the scheduler will simply
throttle it until its next scheduling period. This throttling is needed to
ensure that the process cannot interfere with other processes on the
system, but it can be a problem if a process occasionally has a legitimate
need for more than its allotted time. Bandwidth reclaiming just does the
obvious thing: it gives that process more time if it's not needed by other
processes in the system.
What is perhaps less obvious is the determination of how much CPU time is not actually needed. This is done with the GRUB ("greedy utilization of unused bandwidth") algorithm described in this paper [PDF]. In short, GRUB tracks how much of the available CPU time is actually being used by the set of running deadline tasks and, from that, forms an estimate of how much CPU time will go unused. With that estimate in place, handing out some of the spare time to a deadline process that finds itself in need is a relatively straightforward business.
CPU-frequency scaling is an important tool in the power-management portfolio, but it has traditionally not played well with realtime scheduling algorithms, including deadline scheduling. In current kernels, it is assumed that realtime tasks need the full power of the CPU, so the presence of such tasks will cause the CPU to run at full speed. That may be wasteful, though, if the deadline processes running do not need that much CPU time.
Fixing that problem requires a number of changes, starting with the fact that the deadline scheduler itself assumes that the CPU will be running at full speed. The scheduler needs to be fixed so that it can scale reservation times to match the current speed of the processor. This awareness needs to be expanded to heterogeneous multiprocessing systems (such as big.LITTLE, where not all processors in the system are equally fast) as well.
Once that is done, it would be beneficial to be able to drive CPU-frequency selection from the deadline scheduler as well. The CFS scheduler used for normal tasks uses the per-entity load tracking mechanism to help with frequency selection, but the deadline scheduler currently just pushes the frequency to the maximum. Once the bandwidth reclaiming code is in, it will become possible to measure and use the actual load added by deadline tasks. At that point, a CPU frequency that efficiently gets all of the necessary work done can be chosen.
Of course, there are always a number of fiddly details to take care of. For example, on ARM systems, CPU-frequency changes are done in a separate worker thread. For CPU scaling and deadline scheduling to work together, a way for that thread to preempt deadline tasks (which are normally not preemptable) will need to be found.
The deadline scheduler currently works at the level of individual processes; it does not work with control groups. But there are times when it might make sense to give a deadline reservation to a group of processes. Lelli cited virtual-machine threads and rendering pipelines as a couple of candidate workloads for group deadline scheduling. The implementation envisioned here would be a sort of two-level hybrid hierarchy. At the top level, the EDF algorithm would be used to pick the next group to execute; within that group, though, normal realtime scheduling (FIFO or round-robin) would be used instead. Once this feature works, he said, it could supplant the longstanding realtime throttling mechanism.
Looking further ahead, Lelli said there is a scheme to extend the bandwidth reclaiming mechanism to allow priority demotion. Once a process exceeds its reservation, it will continue to run, but as a normal process without realtime priority. That priority will be restored once the next scheduling period starts. There is also a strong desire to have fully energy-aware scheduling in the deadline scheduler.
A more distant wishlist item is support for single-CPU affinity. The priority inheritance mechanism could also stand some improvements. Currently, a task that blocks a deadline task will inherit that task's deadline. Replacing that with an algorithm like the multiprocessor bandwidth inheritance protocol [PDF] would be desirable. There is also a wish for a dynamic feedback mechanism that could adjust a process's reservation based on its observed needs. But, for the time being, he said, nobody is actually working on these items.
The video of this session is available.
[Thanks to Linaro and the Linux Foundation for funding your editor's travel to Connect.]
Patches and updates
Kernel trees
Architecture-specific
Core kernel code
Development tools
Device drivers
Device driver infrastructure
Documentation
Filesystems and block I/O
Memory management
Networking
Security-related
Virtualization and containers
Miscellaneous
Page editor: Jonathan Corbet
Distributions
Debian Project Leader election—2017 edition
After last year's anticlimactic Debian Project Leader (DPL) election, where the one and only candidate resoundingly beat "none of the above", this year's edition will be a contest, at least. Two candidates have stepped forward: current DPL Mehdi Dogguy and Chris Lamb. They both have outlined their platforms and the campaigning period has opened. Voting will take place in the first half of April, with results available on April 16.
While it does seem that DPL elections are seeing fewer candidates these days, it is rare to see a one-candidate election. It only ever happened once before, in 2011, when then-DPL Stefano Zacchiroli ran for re-election unopposed. Most other DPL elections have had three or more candidates. The decline in the number of candidates has led at least one Debian developer to wonder whether the project should consider eliminating the DPL position entirely.
Mehdi Dogguy
Dogguy is the incumbent this year and his platform reflects some of the experience he gained during his tenure as DPL. But some of the problems and areas to work on that he called out in 2016 still persist, so some parts of the platform have been recycled from last year's, which he links to. In particular, he points to the difficulty of recruiting more contributors. In both platforms, he notes a lack of documentation as a key contributing factor to the recruitment woes. It will require a multi-year effort to fix that, but he had some success in attracting students' attention to Debian at an event he participated in while DPL. Events like that, along with internship programs like Outreachy, will be helpful to the recruitment efforts and he intends to continue those kinds of activities if re-elected.
In his talk at DebConf16 (and in a related BoF), he has proposed the creation of a roadmap for the distribution to help guide its development:
He intends to spearhead the roadmap effort once the "Stretch" (Debian 9) release is out the door. The plan is to establish SMART criteria to help track the progress of the items on the roadmap.
Dogguy would also like to see the project's fundraising put on a more stable footing by adding a "partners program" that would make it easier to budget funds over longer time frames. These partners would commit to a certain level of support over a few years. In addition, he hopes that the funding provided by the partner companies and organizations will help reduce the fundraising burden for DebConf organizers so they can focus more on the event itself.
He would also like to push forward on the "Bikesheds" project, which has been percolating in Debian circles for some time. It is a way for developers to create their own repositories similar to the Ubuntu personal package archives (PPAs). The name evidently comes from a DebConf15 announcement—complaints have been heard about it—but the idea goes back to a 2013 posting to the debian-devel mailing list.
The project is not well understood within the Debian community, Dogguy said, so he would like to gather the right people for a sprint to fully describe what it is and what is needed to make it happen.
There is more to his platform, of course, but that brushes on the high
points. His priorities for his next term if he is elected are:
"ensuring the community remains safe and fun
", the roadmap,
clarifying Bikesheds, and the partners program. In many ways, he is
planning to "stay the course" that he set in his current term, though there
are some new initiatives he would like to help drive.
Chris Lamb
Lamb's platform begins
with a bit of a lament that Debian is not more
prominent among distributions: "Although the open source environment
is not a zero-sum game, I cannot help feel a pang of regret whenever I hear
initiatives — especially headline-grabbing ones — that are based on our
derivatives rather than us.
" He worries that the distribution may
be relegated to being a glue layer for containers or Internet of Things
devices, which will make it harder to attract contributors.
That said, he believes that "Debian is working incredibly
well
", but that its image is not what it should be. Some amount of
work on marketing the distribution is needed:
Like Dogguy, Lamb
is concerned that the documentation for newcomers and potential
contributors is lacking. In addition, some of the processes that
contributors need to understand and use are seen, negatively, as hurdles
and obstacles.
It is something of a tragedy, he said, since Debian is at the forefront of
various important initiatives such as the reproducible builds effort
(which Lamb is active in). But
without raising the visibility of Debian somewhat, he fears the
distribution will be left behind to some extent. "We do not want to
become — or even perceived to be — just a high-quality package
repository.
"
Lamb sets out four concrete steps that he would take as DPL. He would
like to organize more in-person gatherings and meetings, such as DebConfs,
hackathons, summits, sprints, and bug-squashing parties. These meetings
have effects that go well beyond whatever work gets done at the time
because "they act as a social lubricant for subsequent online
communications that can go awry
". He would like to encourage and
help organize more such events and to help grow the number and diversity of
people who attend them.
The "onboarding" process for new users and developers needs improvement and
he would like to make that one of his focuses. Usability testing could be
one way to identify where the problems are in that process, as well as
identifying areas where new users are stymied in their efforts to actually
try Debian out. Creating a Debian-specific outreach initiative along the
lines of Outreachy is also something he would like to do. Outreachy has
been "incredibly successful
", and a similar project within
Debian would allow "more flexibility in the manner of
contributions as well as underline Debian's dedication to 'universality' in
all its forms with the public at large
".
His final concrete goal would be to remove blockers to working efficiently
on Debian. He would like to use some of the project's "surfeit of
funds
" to provide better hardware where it is needed, but also to
change the culture somewhat. If projects could do their jobs better with
some additional resource, he wants them to have "no hesitation in
asking for it
". He would like to find creative solutions for any
social or personality blockers as well.
No DPL?
Before Lamb or Dogguy had nominated themselves, Guillem Jover posted an idea to the debian-project mailing list: not electing a DPL at all. The DPL role is largely symbolic in many ways, so perhaps the project could do without it:
The truth is that even though the constitution grants _some_ powers to the DPL, they are in general not used, because IMO the project would not see those actions with good eyes. The reality is that the DPL is pretty much a bureaucrat and an ambassador of the project trying to represent its collective views towards the outside world.
Others in the short thread did not see things quite that way. Adam
Borowski called the DPL position "a
largely thankless, massive amount of work that's contrary to what Debian is
about (code hacking and solving technical problems[1])
"—though his
footnote also added "flamewars". The title is a perk and removing it might
make the job even less appealing. Others more or less agreed.
Referendum
The election is effectively a referendum on Dogguy's term as DPL. There are no huge differences in the approach or ideas that Dogguy and Lamb have laid out, so it may come down to a question of whether the incumbent has done a good (or even reasonable) job over the last year. There don't seem to be any external indications that Debian is unhappy with Dogguy's service, so it would not be a surprise to see him re-elected. In addition, Lamb has not run for the position before and first-time candidates have typically not been elected. But we'll have to wait and see who gets announced as the DPL in mid-April.
Brief items
Distribution quotes of the week
- Will rubber-stamp delegations.
- Will be an ambassador for the project.
- Will be a minister of finances for minutia.
# Cat Supremacy License, version √-1 # # Everyone who recognizes the superiority of the species Felis catus over # mere Homo sapiens is hereby gladly granted the right to use, modify, # distribute, sell, borrow, give, steal, pee on, print out and use as a # kindle, deface, scribble on, give less, more or same respect as $PRESIDENT # of $YOUR_COUNTRY gives to the Constitution, etc, and so on, this software; # with or without modifications, in either a preferred or unpreferred form # for modification, with or without a fee of any kind. # # Those who have yet to mend the error of their ways are also given all of # the above rights, albeit grudgingly.
Chakra 2017.03 "Goedel" released
Chakra, an independent distribution featuring KDE software, has released version 2017.03.
- The installer, Calamares, has been updated to version 3.0.1.91. As a result, users are now able to install Chakra on btrfs and LUKS encrypted partitions. Calamares has received lots of partitioning enhancements and bug fixes since our previous ISO release and the installation process should be smoother than ever.
- Our homegrown Heritage theme for Plasma got a refreshing facelift that we hope you will enjoy.
NetBSD 7.1 released
NetBSD 7.1 has been released with new features and enhancements as well as important fixes. Some highlights include support for Raspberry Pi Zero, initial DRM/KMS support for NVIDIA graphics cards via nouveau, the addition of vioscsi, a driver for the Google Compute Engine disk, Linux compatibility improvements, and more.
Distribution News
Debian GNU/Linux
Bits from the DPL -- January-February 2017
Mehdi Dogguy provides his Debian Project Leader report for January and February. Topics include the Stretch freeze and Bug Squashing Parties, DebConf Committee, Roadmap, Open Source day at EPITA, and more.
Ubuntu family
Ubuntu 12.04 (Precise Pangolin) reaches End of Life on April 28 2017
Ubuntu 12.04 LTS was released April 26, 2012 and is now reaching its end of life. There will be no more updates after April 28. The supported upgrade path is via Ubuntu 14.04 LTS, and users are encouraged to upgrade from 14.04 to 16.04, which will be supported until April 2021.Ubuntu 12.04 ESM (Extended Security Maintenance)
As Ubuntu 12.04 will soon reach its end of life, Canonical is offering 12.04 ESM (Extended Security Maintenance). Ubuntu Advantage customers will have access to a private archive containing important security fixes for the kernel and the most essential user space packages in Ubuntu 12.04.
Newsletters and articles of interest
Distribution newsletters
- DistroWatch Weekly (March 13)
- Lunar Linux weekly news (March 10)
- Mageia Weekly roundup (March 10)
- openSUSE news (March 9)
- openSUSE news (March 13)
- Tumbleweed Review of the week (March 11)
- Ubuntu Weekly Newsletter (March 12)
How to build an IoT project with Mongoose OS (Opensource.com)
Opensource.com introduces Mongoose OS. "There are many approaches to tackle the MCU development, but generally speaking, it is not easy for a new person to start. One needs to know C/C++ and spend time (sometimes a significant amount) on setting up the programming environment, but tools for simplifying the process are available. One such tool is Mongoose OS, which is an operating system for microcontrollers that makes programming them easy for both newbies and professional developers. With Mongoose OS, the time it takes to set up the programming environment is reduced to a minute or less, thanks to the features it provides..."
Red Hat Product Security Risk Report 2016
Red Hat has released its annual report on the vulnerabilities that afflicted its products and how they were handled. "Looking only at issues affecting base Red Hat Enterprise Linux releases, we released 38 Critical security advisories addressing 50 Critical vulnerabilities. Of those issues, 100% had fixes the same or next day after the issue was public. During that same timeframe, across the whole Red Hat portfolio, 76% of Critical issues had updates to address them the same or next day after the issue was public with 98% addressed within a week of the issue being public."
Page editor: Rebecca Sobol
Development
Delayed execution for Python
A discussion about more efficient debug logging on the python-ideas mailing list quickly morphed into thinking about a more general construct for Python: a delayed evaluation mechanism. The basic problem is that Python will fully evaluate arguments to functions even when they will end up being unused. That is always inefficient but may not seriously affect performance except for expensive argument calculations, where that inefficiency can really add up.
The discussion started with a post from Barry Scott, who was looking for a way to avoid the costly evaluation of arguments to a debug logging routine. The value of the arguments would never be used because debugging was disabled. He had code something like the following:
debug = False def debuglog(msg): if debug: print('Debug: %s' % (msg,)) debuglog('Info: %s' % (expensive(),))
A way to avoid the call to expensive(), since the value would never be used, is what Scott was seeking. Several people suggested using lambda to create a "callable" object and to pass that to debuglog():
def debuglog(msg): if debug: if callable(msg): msg = msg() print('Debug: %s' % (msg,)) debuglog(lambda: 'Info: %s' % (expensive(),))
Python's lambda expressions create a temporary function (i.e. a callable object), so the effect here is to pass the string as a function. It will only be evaluated in debuglog() if debugging messages are enabled, thus avoiding the expensive() call when it is not needed.
Victor Stinner suggested using a
preprocessor to remove the debug code for production as PEP 511 (which he
authored) would allow if it gets accepted. But Marc-Andre Lemburg said: "preprocessors are evil, let's
please not have them in Python :-)
". Instead, he recommended using
the __debug__ flag and the -0
command-line option for production, which will cause Python to not
generate any code
for if __debug__: blocks. It will, however, also eliminate
assert statements, which Stinner saw as a flaw to that plan.
Meanwhile, Steven D'Aprano noted that he
has sometimes thought that Python should have some kind of delayed (or
lazy) evaluation construct. For example purposes, he used a construct like
"<#expensive()#>" as a way to create a "lightweight
'thunk' for
delayed evaluation
". Python does not have thunks, however; D'Aprano
believes that adding them would help solve the delayed/lazy evaluation
problem:
That thread led Joseph Hackman to propose a new delayed keyword to denote expressions that should be lazily evaluated. Here is an example of how the new keyword would be used:
debuglog('Info: %s', (delayed: expensive(),))
Hackman went on to describe how he envisioned it working:
Joseph Jevnik pointed to the lazy module, which uses a decorator to identify functions that should be lazily evaluated. David Mertz also mentioned the Dask parallel computing library, which has a delayed() function to indicate deferred evaluation. In the earlier thread, comparisons were made to generators and Future objects, as well. Some of those might serve as inspiration for implementing lazy evaluation in the core language.
One problem with the proposal was pointed out by D'Aprano: adding new keywords to Python (or any language) is difficult. They are not backward compatible and will break working code. Something like "delayed" is quite likely to have been used by vast numbers of programs as a variable or function name, for example. He also had questions about the semantics of delayed, especially with regard to exactly what would actually trigger the evaluation; that is, when does the value become concrete?
D'Aprano and Chris Angelico asked some questions about how it would all work. Hackman would like to see it remain simple:
Angelico asked about putting delayed
objects into collections (e.g. lists, dictionaries); would that cause the object
to be evaluated or not? It is an important question, since variable-length
argument lists and keyword arguments are both packaged into collections
before being passed to the function. But Hackman thinks it should all work out (with
"some TLC
") because the actual, concrete values are not
required to put objects into lists or as values in dictionaries.
There was some inevitable bikeshedding about names as well. Abe Dillon suggested "lazy" as a shorter
keyword. Joshua Morton did some research on GitHub repositories and found that "deferred" seems to be the least
used among the terms he tried ("delay, defer, lazy, delayed,
deferred, etc.
"), but it still appears 350,000 times. There was
also discussion of whether the colon was needed or desired, without any
clear-cut consensus.
In a third thread, Michel Desmoulin described another use case for lazy (or delayed). He has some code that is similar to the following:
val = conf.get('setting', load_from_db('setting'))But that means that the setting is queried from the database each time. He would rather do something like:
val = conf.get('setting', lazy load_from_db('setting'))
That, of course, led to ideas for other ways to approach the problem, but they suffered from a few disadvantages. One could make conf a subclass of dict and define a __missing__() method to call load_from_db(), as Angelico suggested. Or create a different kind of dict subclass, as Markus Meskanen proposed. Both of those make some assumptions as Desmoulin pointed out:
- all code using conf are using load_from_db as a default value;
- load_from_db exists for all code using the conf object
He went on to outline a couple other features that are not "needed" in
Python (e.g. list comprehensions), but he conceded that "you don't need
lazy, it's just convenient
". He further expanded on that in another post, showing the reasons he thinks
that the other solutions, while potentially workable in some cases, are not
particularly convenient or elegant:
Yes we can live without it. I mean, Python is already incredibly convenient, of course whatever we suggest now is going to be a cherry on top of the language cake.
Hackman plans to write up a PEP for lazy, though nothing has been posted yet. But Lemburg is unconvinced that the feature can be specified well enough to be useful:
IMO, there are much better ways to write code which only evaluates expensive code when really needed.
I don't see how "lazy" could automate this in a well defined, helpful and obvious way, simply because the side effects of moving evaluation from the place of definition to an arbitrary other place in the code are not easy to manage.
In the end, any new keyword is going to be a hard sell. Some other syntax might make the feature more palatable, but BDFL Guido van Rossum is notoriously averse to operators that seem "Perl-esque", so that will need to be avoided as well. The lazy feature certainly garnered some support in the threads, but few core developers participated, so it is hard to know how the PEP might be received.
Brief items
Development quotes of the week
LLVM 4.0.0 released
The LLVM 4.0.0 release is out. "This release is the result of the community's work over the past six months, including: use of profile data in ThinLTO, more aggressive aggressive dead code elimination, experimental support for coroutines, experimental AVR target, better GNU ld compatibility and significant performance improvements in LLD, as well as improved optimizations, many bug fixes and more." The LLVM compiler project has moved to a new numbering scheme with this release, where the first number increments with each major release.
MATE 1.18 released
Version 1.18 of the MATE desktop has been released. "The release is focused on completing the migration to GTK3+ and adopting new technologies to replace some of deprecated components MATE Desktop 1.16 still relied on."
SciPy 0.19.0
Scipy 0.19.0 has been released. "SciPy 0.19.0 is the culmination of 7 months of hard work. It contains many new features, numerous bug-fixes, improved test coverage and better documentation. There have been a number of deprecations and API changes in this release, which are documented below. All users are encouraged to upgrade to this release, as there are a large number of bug-fixes and optimizations. Moreover, our development attention will now shift to bug-fix releases on the 0.19.x branch, and on adding new features on the master branch."
U-Boot v2017.03 is released
U-Boot 2017.03 has been released. "So, some biggish news. As things stand today, this is the last release where the Blackfin and SPARC, unless a new maintainer wants to step in. The currently listed maintainers haven't gotten back to me of late."
Newsletters and articles
Development newsletters
- Emacs news (March 13)
- These Weeks in Firefox (March 14)
- What's cooking in git.git (March 8)
- What's cooking in git.git (March 10)
- What's cooking in git.git (March 13)
- What's cooking in git.git (March 14)
- Git Rev News (March 15)
- OCaml Weekly News (March 14)
- Perl Weekly (March 13)
- PostgreSQL Weekly News (March 12)
- Python Weekly (March 9)
- Ruby Weekly (March 9)
- This Week in Rust (March 14)
- Wikimedia Tech News (March 13)
Haas: Parallel Query v2
Robert Haas describes the many parallelism enhancements in the upcoming PostgreSQL 10 release. "The Gather node introduced in PostgreSQL 9.6 gathers results from all workers in an arbitrary order. That's fine if the data that the workers were producing had no particular ordering anyway, but if each worker is producing sorted output, then it would be nice to gather those results in a way that preserves the sort order. This is what Gather Merge does. It can speed up queries where it's useful for the results of the parallel portion of the plan to have a particular sort order, and where the parallel portion of the plan produces enough rows that performing an ordinary Gather followed by a Sort would be expensive."
Page editor: Rebecca Sobol
Announcements
Brief items
GNU Toolchain now accepting donations with the support of the Free Software Foundation
The Free Software Foundation has announced that it is accepting donations to support the GNU Toolchain. "Many pieces of software depend upon the GNU Toolchain, including the GNU/Linux family of operating systems which runs the majority of Web servers, millions of personal devices and the most advanced supercomputers. Donations made through the FSF will help speed development of the GNU Toolchain projects, for example by compensating developers working on critical components, upgrading servers and other infrastructure, and facilitating in-person opportunities for collaboration and project advocacy."
Articles of interest
FSFE Newsletter - March 2017
This edition of the Free Software Foundation Europe newsletter covers the Chronicles of LiMux, FSFE and OpenForum Europe public policy event, FSFE at FOSDEM, and more.FSF: Do GitHub's updated terms of service conflict with copyleft?
The Free Software Foundation looks at GitHub's new terms of service. "GitHub's updated terms caused a great deal of concern, but while they are confusing, they do not appear to be incompatible with copyleft. The Free Software Foundation (FSF), though, still recommends using other code hosting sites."
Three challenges for the web, according to its inventor
The world wide web has been around for 28 years now. Web inventor Sir Tim Berners-Lee writes about the challenges facing the modern web, including the loss of control of our personal data, the spread of misinformation, and the lack of transparency in political advertising. "Political advertising online has rapidly become a sophisticated industry. The fact that most people get their information from just a few platforms and the increasing sophistication of algorithms drawing upon rich pools of personal data, means that political campaigns are now building individual adverts targeted directly at users. One source suggests that in the 2016 US election, as many as 50,000 variations of adverts were being served every single day on Facebook, a near-impossible situation to monitor. And there are suggestions that some political adverts – in the US and around the world – are being used in unethical ways – to point voters to fake news sites, for instance, or to keep others away from the polls. Targeted advertising allows a campaign to say completely different, possibly conflicting things to different groups. Is that democratic?"
Calls for Presentations
13th Netfilter Workshop
The Netfilter Workshop will take place July 3-7 near Faro, Portugal. "Attendance requires an invitation. Linux networking developers with contributions to any of the Netfilter subsystems and users with interesting usecases and open problems are also welcome. We have traditionally left room for other projects that rely on Netfilter infrastructure such as the Linux Virtual Server project. You can send us proposal in a very lightweight format: title and quick abstract (not more than 500 words!) as well as estimated time to present." The proposal deadline is May 30.
CFP Deadlines: March 16, 2017 to May 15, 2017
The following listing of CFP deadlines is taken from the LWN.net CFP Calendar.
Deadline | Event Dates | Event | Location |
---|---|---|---|
March 18 | June 19 June 20 |
LinuxCon + ContainerCon + CloudOpen China | Beijing, China |
March 20 | May 4 May 6 |
Linuxwochen Wien 2017 | Wien, Austria |
March 27 | July 10 July 16 |
SciPy 2017 | Austin, TX, USA |
March 28 | October 23 October 24 |
All Things Open | Raleigh, NC, USA |
March 31 | June 26 June 28 |
Deutsche Openstack Tage 2017 | München, Germany |
April 1 | April 22 | 16. Augsburger Linux-Infotag 2017 | Augsburg, Germany |
April 2 | August 18 August 20 |
State of the Map | Aizuwakamatsu, Fukushima, Japan |
April 10 | August 13 August 18 |
DjangoCon US | Spokane, WA, USA |
April 10 | July 22 July 27 |
Akademy 2017 | Almería, Spain |
April 14 | June 30 | Swiss PGDay | Rapperswil, Switzerland |
April 16 | July 9 July 16 |
EuroPython 2017 | Rimini, Italy |
April 18 | October 2 October 4 |
O'Reilly Velocity Conference | New York, NY, USA |
April 20 | April 28 April 29 |
Grazer Linuxtage 2017 | Graz, Austria |
April 20 | May 17 | Python Language Summit | Portland, OR, USA |
April 23 | July 28 August 2 |
GNOME Users And Developers European Conference 2017 | Manchester, UK |
April 28 | September 21 September 22 |
International Workshop on OpenMP | Stony Brook, NY, USA |
April 30 | September 21 September 24 |
EuroBSDcon 2017 | Paris, France |
May 1 | May 13 May 14 |
Linuxwochen Linz | Linz, Austria |
May 1 | October 5 | Open Hardware Summit 2017 | Denver, CO, USA |
May 2 | October 18 October 20 |
O'Reilly Velocity Conference | London, UK |
May 5 | June 5 June 7 |
coreboot Denver2017 | Denver, CO, USA |
May 6 | September 13 September 15 |
Linux Plumbers Conference 2017 | Los Angeles, CA, USA |
May 6 | September 11 September 14 |
Open Source Summit NA 2017 | Los Angeles, CA, USA |
May 7 | August 3 August 8 |
PyCon Australia 2017 | Melbourne, Australia |
If the CFP deadline for your event does not appear here, please tell us about it.
Upcoming Events
Schedule posted: Explore the roots of freedom at LibrePlanet 2017
The Free Software Foundation looks forward to LibrePlanet, March 25-26 in Cambridge, MA. "This year, the LibrePlanet program will include more than 50 speakers, an array of practical workshops, the opportunity for any attendee to give a lightning talk, and for the first time, Birds of a Feather (BoF) sessions, informal conversations based around shared interests—another great way for anybody at LibrePlanet to explore ideas important to free software, whether they're something not already on the program, or a deeper conversation jumping off of a LibrePlanet talk."
Netdev Conference: What you have been missing
This Netdev 2.1 update covers a conference mailing list, new sponsors, new talks and more. Netdev will take place April 6-8 in Montreal, Canada.Events: March 16, 2017 to May 15, 2017
The following event listing is taken from the LWN.net Calendar.
Date(s) | Event | Location |
---|---|---|
March 16 March 17 |
IoT Summit | Santa Clara, CA, USA |
March 17 March 19 |
FOSS Asia | Singapore, Singapore |
March 17 March 19 |
MiniDebConf Curitiba 2017 | Curitiba, Brazil |
March 18 | Open Source Days Copenhagen | Copenhagen, Denmark |
March 18 March 19 |
curl up - curl meeting 2017 | Nuremberg, Germany |
March 20 March 21 |
Linux Storage, Filesystem & Memory Management Summit | Cambridge, MA, USA |
March 22 March 23 |
Vault | Cambridge, MA, USA |
March 25 March 26 |
LibrePlanet 2017 | Cambridge, MA, USA |
March 28 March 31 |
PGConf US 2017 | Jersey City, NJ, USA |
April 3 April 4 |
Power Management and Scheduling in the Linux Kernel Summit | Pisa, Italy |
April 3 April 6 |
‹Programming› 2017 | Brussels, Belgium |
April 3 April 6 |
Open Networking Summit | Santa Clara, CA, USA |
April 3 April 7 |
DjangoCon Europe | Florence, Italy |
April 5 April 6 |
Dataworks Summit | Munich, Germany |
April 6 April 8 |
Netdev 2.1 | Montreal, Canada |
April 10 April 13 |
IXPUG Annual Spring Conference 2017 | Cambridge, UK |
April 17 April 20 |
Dockercon | Austin, TX, USA |
April 21 | Osmocom Conference 2017 | Berlin, Germany |
April 22 | 16. Augsburger Linux-Infotag 2017 | Augsburg, Germany |
April 26 | foss-north | Gothenburg, Sweden |
April 28 April 29 |
Grazer Linuxtage 2017 | Graz, Austria |
April 28 April 30 |
Penguicon | Southfield, MI, USA |
May 2 May 4 |
3rd Check_MK Conference | Munich, Germany |
May 2 May 4 |
samba eXPerience 2017 | Goettingen, Germany |
May 2 May 4 |
Red Hat Summit 2017 | Boston, MA, USA |
May 4 May 5 |
Lund LinuxCon | Lund, Sweden |
May 4 May 6 |
Linuxwochen Wien 2017 | Wien, Austria |
May 6 May 7 |
LinuxFest Northwest | Bellingham, WA, USA |
May 6 May 7 |
Community Leadership Summit 2017 | Austin, TX, USA |
May 6 May 7 |
Debian/Ubuntu Community Conference - Italy | Vicenza, Italy |
May 8 May 11 |
O'Reilly Open Source Convention | Austin, TX, USA |
May 8 May 11 |
OpenStack Summit | Boston, MA, USA |
May 8 May 11 |
6th RISC-V Workshop | Shanghai, China |
May 13 May 14 |
Open Source Conference Albania 2017 | Tirana, Albania |
May 13 May 14 |
Linuxwochen Linz | Linz, Austria |
If your event does not appear here, please tell us about it.
Page editor: Rebecca Sobol