Linux Format - UK (2019-12)

(Antfer) #1
inus Torvalds announced the release
of Linux 5.4-rc5, which should have
been smaller than it was given that
the current development cycle is coming to a
close. Still, he wasn’t too concerned about the
slight bloat. If things continue to plan, the final
release of 5.4 should be featured in our
summary next issue.

Is hibernation usable?
Linux has supported hibernation (suspending
to disk) for many years. This differs from the
typical ‘suspend’ (closing the lid on your
laptop) in that the latter relies upon special
hardware support maintaining the contents
of RAM while effectively shutting down almost
everything else. This allows for a very fast
suspend, while limiting power draw
sufficiently to last a few days.
With hibernation, the machine is actually
fully powered-down and can maintain a
suspended state almost indefinitely. But a
hibernation to disk typically takes much
longer than a simple suspend. And it turns out
that there are some little-documented issues
with hibernation.
These issues include a restriction on the
system being able to use more than half of
available RAM during the process – the other
half is used to store the image being prepared
to be written to system swap space. As a

result, the current hibernate logic will free up
memory in the process, dropping cached state
and other unnecessary memory use. It mostly
works, but as Luigi Semenzato noted, it may not
always. These and other limitations caused him
to ask aloud whether hibernation is useful, and
whether it needs to be fixed.

Thermal pressure
Thara Gopinath posted a patch series titled
Introduce Thermal Pressure, which aims to
teach the kernel’s scheduler about the impact
of thermals upon maximum CPU frequency.
The kernel currently understands that
processors implement DVFS (Dynamic Voltage
and Frequency Scaling), in which the operating
frequency of cores on the same die (chip) are
adjusted continually in accordance with the load.
If a machine is not too busy, there are ‘governor’
algorithms that automatically throttle down the
speed to save power.
Until now, the kernel did not understand that
there is another interaction between frequency
and temperature. Under sufficient thermal
‘pressure’, the processor may automatically
throttle back the maximum operating frequency
in order to avoid damage to the hardware, or
because the cooling solution is not sufficient to
maintain normal operation – in a phone, for
example. The new patches aim to teach the
scheduler how to incorporate thermals too.

OPINION


Recently, there was
a post on the Linux
Kernel Mailing List
pondering the future of
packet-writing support.
This is a mechanism,
implemented by a driver
known as ‘pktcdvd’, used
when writing data to
rewriteable DVD and Blu-ray
media in such a way that the
disks can be treated as
mountable filesystems. The
poster was concerned that
the driver was going away
and was keen to point out
that optical drives are still
on sale and even used.
My first reaction upon
reading this was twofold.
First, the inevitable question
of when had I last used a
physical CD, DVD or Blu-ray
disk. That I couldn’t really
remember, and that it
wasn’t a big deal, alarmed
me a little, in the same way
that progress sometimes
does. Secondly – and even
though I had just
established I didn’t care
about DVDs much any more


  • I assumed there was no
    way that support for
    rewriteable disks was
    now obsolete.
    It turns out that I was
    wrong. The driver was,
    in fact, marked as
    ‘deprecated’ and ‘orphaned’
    back in 2016. In theory this
    means it could just go away.
    And few people seem to
    even care or notice. If that
    isn’t an interesting sign of
    the changing times in which
    we live, then I’m not
    sure what is.


Jon Masters is a kernel hacker
who’s been involved with Linux for
more than 22 years, and works on
energy-efficient Arm servers.

WHAT DVD?


L


ONGOING DEVELOPMENT


Dmitry Safonov posted ‘kernel: Introduce
Time Namespace’, a patch series that adds
a new namespace for managing the
perceived time as seen by processes.
A typical use case will be to apply a time
namespace to a cgroup containing the
running tasks of a container, allowing a
system administrator to alter time seen by
applications. More importantly, it will allow
container orchestration tooling to adjust
the time seen by applications, particularly
during migration.
When moving containers from one host
to another, the two hosts may not agree or
be sychronised to the same time, which
could otherwise have a devastating impact
on applications not expecting discontinuity.

Jessica Yu (maintainer of in-kernel
module loading support) let everyone know
that a new feature merged in Linux 5.3 may
be the cause of some problems seen when
trying to load drivers. The new feature is
known as ‘symbol namespaces’, and is
intended to allow limits to be placed upon
modules in the kernel that may use
symbols (functions and data) provided by
other modules, or by core components of
the main kernel image. But it also has the
unintended consequence of breaking some
soft dependencies between modules.
Fancis Deslauriers announced that
videos from the Tracing Summit 2019
talks are now available at:
http://bit.ly/lxf257kernel.

Kernel Watch


Jon Masters summarises the latest happenings


in the Linux kernel, so that you don’t have to.


10 LXF257 December 2019 http://www.linuxformat.com

NEWSDESK


inusTorvaldsannouncedtherelease
ofLinux5.4-rc5,whichshouldhave
beensmallerthanitwasgiventhat
thecurrentdevelopmentcycleiscomingtoa
close.Still,hewasn’ttooconcernedaboutthe
slightbloat.Ifthingscontinuetoplan,thefinal
releaseof5.4shouldbefeaturedinour
summarynextissue.

Ishibernationusable?
Linuxhassupportedhibernation(suspending
todisk)formanyyears.Thisdiffersfromthe
typical‘suspend’(closingthelidonyour
laptop)inthatthelatterreliesuponspecial
hardwaresupportmaintainingthecontents
ofRAMwhileeffectivelyshuttingdownalmost
everythingelse.Thisallowsforaveryfast
suspend,whilelimitingpowerdraw
sufficientlytolastafewdays.
Withhibernation,themachineisactually
fullypowered-downandcanmaintaina
suspendedstatealmostindefinitely.Buta
hibernationtodisktypicallytakesmuch
longerthanasimplesuspend.Anditturnsout
thattherearesomelittle-documentedissues
withhibernation.
Theseissuesincludearestrictiononthe
systembeingabletousemorethanhalfof
availableRAMduringtheprocess–theother
halfisusedtostoretheimagebeingprepared
tobewrittentosystemswapspace.Asa

result,thecurrenthibernatelogicwillfreeup
memoryintheprocess,droppingcachedstate
andotherunnecessarymemoryuse.Itmostly
works,butasLuigiSemenzatonoted,itmaynot
always.Theseandotherlimitationscausedhim
toaskaloudwhetherhibernationisuseful,and
whetheritneedstobefixed.

Thermalpressure
TharaGopinathpostedapatchseriestitled
IntroduceThermalPressure,whichaimsto
teachthekernel’sschedulerabouttheimpact
ofthermalsuponmaximumCPUfrequency.
Thekernelcurrentlyunderstandsthat
processorsimplementDVFS(DynamicVoltage
andFrequencyScaling),inwhichtheoperating
frequencyofcoresonthesamedie(chip)are
adjustedcontinuallyinaccordancewiththeload.
Ifamachineisnottoobusy,thereare‘governor’
algorithmsthatautomaticallythrottledownthe
speedtosavepower.
Untilnow,thekerneldidnotunderstandthat
thereisanotherinteractionbetweenfrequency
andtemperature.Undersufficientthermal
‘pressure’,theprocessormayautomatically
throttlebackthemaximumoperatingfrequency
inordertoavoiddamagetothehardware,or
becausethecoolingsolutionisnotsufficientto
maintainnormaloperation–inaphone,for
example.Thenewpatchesaimtoteachthe
schedulerhowtoincorporatethermalstoo.

OPINION


Recently,therewas
apostontheLinux
KernelMailingList
ponderingthefutureof
packet-writingsupport.
Thisisamechanism,
implementedbyadriver
knownas‘pktcdvd’,used
whenwritingdatato
rewriteableDVDandBlu-ray
mediainsuchawaythatthe
diskscanbetreatedas
mountablefilesystems.The
posterwasconcernedthat
thedriverwasgoingaway
andwaskeentopointout
thatopticaldrivesarestill
onsaleandevenused.
Myfirstreactionupon
readingthiswastwofold.
First,theinevitablequestion
ofwhenhadIlastuseda
physicalCD,DVDorBlu-ray
disk.ThatIcouldn’treally
remember,andthatit
wasn’tabigdeal,alarmed
mealittle,inthesameway
thatprogresssometimes
does.Secondly–andeven
thoughIhadjust
establishedIdidn’tcare
aboutDVDsmuchanymore


  • Iassumedtherewasno
    waythatsupportfor
    rewriteablediskswas
    nowobsolete.
    ItturnsoutthatIwas
    wrong.Thedriverwas,
    infact,markedas
    ‘deprecated’and‘orphaned’
    backin2016.Intheorythis
    meansitcouldjustgoaway.
    Andfewpeopleseemto
    evencareornotice.Ifthat
    isn’taninterestingsignof
    thechangingtimesinwhich
    welive,thenI’mnot
    surewhatis.


JonMastersisakernelhacker
who’sbeeninvolvedwithLinuxfor
morethan 22 years,andworkson
energy-efficientArmservers.


WHAT DVD?


L


ONGOINGDEVELOPMENT


DmitrySafonovposted‘kernel:Introduce
TimeNamespace’,apatchseriesthatadds
anewnamespaceformanagingthe
perceivedtimeasseenbyprocesses.
Atypicalusecasewillbetoapplyatime
namespacetoacgroupcontainingthe
runningtasksofacontainer,allowinga
systemadministratortoaltertimeseenby
applications.Moreimportantly,itwillallow
containerorchestrationtoolingtoadjust
thetimeseenbyapplications,particularly
duringmigration.
Whenmovingcontainersfromonehost
toanother,thetwohostsmaynotagreeor
besychronisedtothesametime,which
couldotherwisehaveadevastatingimpact
onapplicationsnotexpectingdiscontinuity.

JessicaYu(maintainerofin-kernel
moduleloadingsupport)leteveryoneknow
thatanewfeaturemergedinLinux5.3may
bethecauseofsomeproblemsseenwhen
tryingtoloaddrivers.Thenewfeatureis
knownas‘symbolnamespaces’,andis
intendedtoallowlimitstobeplacedupon
modulesinthekernelthatmayuse
symbols(functionsanddata)providedby
othermodules,orbycorecomponentsof
themainkernelimage.Butitalsohasthe
unintendedconsequenceofbreakingsome
softdependenciesbetweenmodules.
FancisDeslauriersannouncedthat
videosfromtheTracingSummit 2019
talksarenowavailableat:
http://bit.ly/lxf257kernel.

Kernel Watch


JonMasterssummarisesthelatesthappenings


intheLinuxkernel,sothatyoudon’thaveto.


10 LXF257December 2019 http://www.linuxformat.com

NEWSDESK

Free download pdf