Linaro Connect Keynote: Todd Kjos "Android kernels: How the sausage is made"





An update on the Android problem

Please consider subscribing to LWN

Subscriptions are the lifeblood of LWN.net. If you appreciate this content and would like to see more of it, your subscription will help to ensure that LWN continues to thrive. Please visit this pageto join up and keep LWN on the net.

By Jonathan Corbet
November 7, 2017
2017 Maintainers Summit
Android has been a great boon to the kernel community, having brought a great deal of growth in both the user and the development communities. But Android has also been a problem in that devices running it ship with kernels containing large amounts (often millions of lines) of out-of-tree code. That fragments the development community and makes it impossible to run mainline kernels on this hardware. The problematic side of Android was discussed at the 2017 Maintainer Summit; the picture that resulted is surprisingly optimistic.

Greg Kroah-Hartman started by saying that he has been working for some time with the system-on-chip (SoC) vendors to try to resolve this problem, which he blames primarily on Qualcomm for having decided not to work upstream. Qualcomm has since concluded that this decision was a mistake and is determined to fix it, but the process of doing so will take years. The other SoC vendors are also committed to closing the gap between the kernels they provide and the mainline but, again, getting there will take a while.

Google's new rules requiring the use of long-term support kernels with Android and keeping up with updates should also help. If vendors do not follow those rules, he said, he will eventually stop maintaining the LTS releases. For now, though, he is running an experiment where he will support the 4.4.x kernels for a period of six years. Vendors are coming around to using those [Greg
Kroah-Hartman]updates, he said, but there is a new problem in the form of carriers who are proving unwilling to ship those updates. He is trying to get carriers to put one out every six months for now.

Rom Lemarchand, Google's Android kernel manager, said that newer devices are shipping with 4.4 kernels now. The SoC market cycle is such that these chips will always run a two-year-old kernel. The two-year support lifetime for LTS kernels thus didn't work well for SoC vendors; just about the time that they ship something, the support goes away. Hopefully the six-year support period will work better. Updates are still a problem, though; vendors still are working under the mentality that they only need to take patches that have CVE numbers attached to them, which is not the case. Kroah-Hartman added that they weren't even taking all of the patches with CVE numbers. Kees Cook said that none of the vendors have decent testing for their kernels and don't want to merge any changes at all. They don't, he said, want to admit that they are bringing in LTS patches.

Along the lines of testing, there was some discussion of the Linux Test Project (LTP). This project has tended to be viewed dismissively by kernel developers, but it is evidently the recipient of more resources and has been getting better. There may eventually be value in integrating LTP into the kernel self tests. Linus Torvalds said that even an improved LTP is not that interesting compared to real workloads, though, so he would much rather see Android running on mainline kernels. This is evidently being worked on, but is not there yet. Lemarchand said that the HiKey boards are staying as close to mainline and can boot a 4.9 kernel, but Arnd Bergmann pointed out that the HiKey boards are no longer being produced.

Somebody asked: has any Android phone ever done a major kernel upgrade after it has been shipped? That is evidently a difficult proposition, since there a number of regulatory certifications that must be redone. But the Galaxy Nexus and Galaxy S phones both saw major kernel upgrades, so it is possible. Torvalds noted that there are a lot of Android devices that are not phones, tablets for example, that might prove to be better development devices. It would be nice if mainline developers could run their own kernels on real devices. Bergmann said that the gap is shrinking on some devices, and Kroah-Hartman repeated that he is working toward this goal with the SoC vendors, but the process should be expected to take about six years.

Cook said that applying the larger updates involved in following the LTS kernels completely should eventually make vendors more comfortable with larger kernel changes in general. Sean Paul said that running mainline kernels on Android devices may well become possible soon, but phones still probably will not jump to new major releases. Even that would be good, though, Bergmann said; the current out-of-tree code problem defeats the goal of building a single ARM kernel for all devices. Fixing that would enable third-party distributors to ship systems for multiple phones. Torvalds said that, even if vendors don't upgrade their devices, the ability to do so would enable some useful regression testing. James Bottomley said that the whole situation is a repeat of the enterprise Linux problem from many years ago.

Ted Ts'o asked if there were any ARM Chromebooks that could be used as development machines; Paul answered that the ones based on Rockchip SoCs were close. Torvalds asked about the status of the Mali GPU driver; Bergmann responded that there had been one person working on reverse-engineering that device, but he didn't work well with other developers. Now somebody else is making progress with the older GPUs, but nobody is working on current-generation devices. It was said that everybody within ARM is in favor of solving the problem by open-sourcing ARM's driver — except for one recalcitrant high-level manager.

Torvalds said that, if the Mali problem could be solved, the community as a whole would be in good shape. Bergmann said that there are currently four ARM GPUs with good free-software support, but they are all older. Going forward, Mali seems to be the GPU of choice for Android devices, so that is the problem that needs to be solved. Lemarchand said that pressure is being applied from the Android side as well.

The final conclusion of this session was that, while the Android problem has not gone away, the situation is far better than it was one year ago.

[Your editor would like to thank the Linux Foundation, LWN's travel sponsor, for supporting his travel to this event].


Android 문제에 대한 업데이트


안드로이드는 커널 커뮤니티에 큰 도움이되었으며 사용자 커뮤니티와 개발 커뮤니티 모두에서 큰 성장을 이루었습니다. 그러나 안드로이드는 많은 양의 (종종 수백만 라인의) 트리가 아닌 코드를 포함하는 커널을 탑재 한 장치를 실행하는 장치에서 문제가되고 있습니다. 이는 개발 커뮤니티를 파괴하고 이 하드웨어에서 메인 라인 커널을 돌리는 것을 불가능하게 만든다. Android의 문제는 2017 Maintainer Summit에서 논의되었습니다. 그 결과로 얻은 그림은 놀라 울 정도로 낙관적 인 것이었다.

Greg Kroah-Hartman은이 문제를 해결하기 위해 시스템 온칩 (SoC) 공급 업체와 함께 얼마 동안 노력해 왔다고 말하면서 시작했습니다. 그는이 문제를 주로 업스트림에서 일하지 않기로 결정한 Qualcomm의 책임이라고 비난했습니다. Qualcomm은 이 결정이 실수 였고이를 수정하기로 결정했지만 그 과정은 수 ​​년이 걸릴 것이라고 결론지었습니다. 다른 SoC 벤더들은 그들이 제공하는 커널과 메인 라인 사이의 갭을 줄이기 위해 노력하고 있지만, 또 다시, 거기에 점점 더 오래 걸릴 것이다.

Android에서 장기 지원 커널을 사용하고 업데이트를 유지해야하는 Google의 새로운 규칙도 도움이됩니다. 공급 업체가 이러한 규칙을 따르지 않는다면 그는 결국 LTS 릴리스 유지를 중단 할 것이라고 그는 말했다. 현재 그는 4.4.x 커널을 6 년 동안 지원할 실험을하고 있습니다. 공급 업체는 이러한 [Greg Kroah-Hartman]업데이트 를 사용하기 위해 다가 가고 있지만, 해당 업데이트를 제공하지 않으려는 항공사의 형태로 새로운 문제가 있다고 그는 말했다. 그는 통신 사업자가 현재 6 개월마다 한 대씩 판매하도록 노력하고 있습니다.

Google의 안드로이드 커널 관리자 인 Rom Lemarchand는 새로운 장치가 현재 4.4 커널로 출하되고 있다고 말했다. SoC 시장 사이클은 이러한 칩이 항상 2 년 된 커널을 실행하는 것과 같습니다. 따라서 LTS 커널의 2 년 지원 수명은 SoC 공급 업체에게 적합하지 않았습니다. 그들이 무언가를 선적 할 무렵에는 지원이 사라집니다. 잘하면 6 년 지원 기간은 더 잘 작동합니다. 그러나 업데이트는 여전히 문제입니다. 공급 업체들은 여전히 ​​CVE 번호가 붙은 패치 만 필요로한다는 사고 방식으로 작업하고 있습니다. Kroah-Hartman은 CVE 번호로 패치를 모두 가져 가지도 않았다고 덧붙였습니다. 키즈 쿡 (Kees Cook)은 벤더 중 어느 누구도 커널 테스트를 제대로하지 않았으며 변경 사항을 병합하지 않을 것이라고 말했다. 그들은하지 않는다고 그는 말했다.

테스트 라인을 따라 LTP ( Linux Test Project)에 대한 토론이있었습니다 이 프로젝트는 커널 개발자들에 의해 무시당하는 경향이 있지만 분명히 더 많은 리소스를받는 사람이며 점점 좋아지고 있습니다. 결국 LTP를 커널 자체 테스트에 통합하는 데 가치가있을 수 있습니다. 리누스 토발즈 (Lius Torvalds)는 개선 된 LTP조차도 실제 작업량에 비해 재미 있지는 않다고 말했다. 그래서 그는 Android가 메인 라인 커널에서 실행되는 것을 많이 보게 될 것이라고 말했다. 이것은 분명히 작업 중이지만 아직 없습니다. Lemarchand는 HiKey 보드가 메인 라인에 가깝게 머물면서 4.9 커널을 부팅 할 수 있다고 말했지만 Arnd Bergmann은 HiKey 보드가 더 이상 생산되지 않는다고 지적했다.

누군가가 물었습니다 : 안드로이드 폰이 출하 된 후 주요 커널 업그레이드를 한 적이 있습니까? 그것은 분명해야 할 어려운 규정입니다. 왜냐하면 거기에 많은 규제 인증을 다시해야하기 때문입니다. 그러나 Galaxy Nexus와 Galaxy S 휴대 전화는 모두 주요 커널 업그레이드를 보았으므로 가능합니다. 토발즈는 휴대폰, 타블렛 등의 안드로이드 기기가 많아 개발 기기가 더 좋을 것이라고 전망했다. 주요 개발자가 실제 장치에서 자체 커널을 실행할 수 있다면 좋을 것입니다. Bergmann은 일부 장치에서 그 격차가 줄어들고 있으며 Kroah-Hartman은 SoC 공급 업체와 함께이 목표를 향해 연구하고 있다고 반복했지만 프로세스는 약 6 년이 걸릴 것으로 예상됩니다.

쿡 (Cook)은 LTS 커널을 완전히 따르는 데 필요한 더 큰 업데이트를 적용하면 궁극적으로 더 큰 커널 변경 사항에 대해 더 안락하게 만들 것이라고합니다. 숀 폴은 안드로이드 기기에서 주류 커널을 실행하는 것이 곧 가능해질 것이라고 말했다. 그러나 휴대폰은 여전히 ​​새로운 메이저 릴리스로 이동하지는 않을 것이라고한다. 비록 그것이 좋을지라도 Bergmann은 말했다. 현재의 트리 외부 코드 문제는 모든 장치에 대해 단일 ARM 커널을 작성하는 목표를 무효로합니다. 이를 통해 타사 배포자는 여러 대의 전화 시스템을 출하 할 수 있습니다. 토발즈는 벤더가 디바이스를 업그레이드하지 않더라도 그렇게 할 수있는 능력이 유용한 회귀 테스트를 가능하게 할 것이라고 말했다. 제임스 보텀 리 (James Bottomley)는이 모든 상황이 수년 전 엔터프라이즈 리눅스 문제의 반복이라고 말했다.

Ted Ts'o는 개발 기계로 사용할 수있는 ARM 크롬 북이 있는지 질문했습니다. Paul은 Rockchip SoC를 기반으로 한 것이 가까운 것이라고 대답했습니다. Torvalds는 Mali GPU 드라이버의 상태에 대해 질문했습니다. Bergmann은이 장치를 리버스 엔지니어링하는 사람이 한 명 있었지만 다른 개발자와는 잘 작동하지 않는다고 대답했습니다. 이제는 다른 사람들이 구형 GPU로 진보하고 있지만, 현재의 장치에서는 아무도 연구하지 않습니다. ARM 내부의 모든 사람들은 불만을 터트려는 한 명의 고위 관리자를 제외하고는 ARM의 드라이버를 오픈 소싱함으로써이 문제를 해결하고자합니다.

토발즈는 말리 문제가 해결 될 수 있다면 공동체 전체가 좋은 모습을 보일 것이라고 말했다. Bergmann은 현재 자유 소프트웨어 지원이 좋은 ARM GPU가 4 개나 있지만 모두 오래되었다고 전했다. 앞으로 말리는 안드로이드 기기의 GPU로 보입니다. 그래서 해결해야 할 문제입니다. Lemarchand는 안드로이드 측에서도 압력이 가해지고 있다고 말했다.

이 세션의 마지막 결론은 Android 문제가 사라지지 않았지만 상황이 1 년 전보다 훨씬 낫다는 것입니다.

[편집자는 LWN의 여행 스폰서 인 Linux Foundation에게이 행사에 대한 여행 지원에 감사드립니다.]


https://lwn.net/Articles/738225/





+ Recent posts