
Linux 4.17-rc1: “We removed more lines than we added” - rbanffy
http://lkml.iu.edu/hypermail/linux/kernel/1804.1/06654.html
======
jimmies
Do you know what is the other thing that 4.17 also does? Optimizing idle loops
so your laptop can run cooler for longer.

Phoronix's initial testing seems to suggest a 10-20% less power usage while
idle which is a fantastic news for those who own a Linux laptop.

Since 4.0 or so Linux has become rock solid for me so I no longer anticipate
new kernel releases but this is one of those times I run the cutting edge
kernel because it is so cool. If you run a relatively recent version of
Ubuntu, you can also test by googling Kernel PPA. It's just three clicks away
at most.

Ref:
[https://www.phoronix.com/scan.php?page=article&item=linux-41...](https://www.phoronix.com/scan.php?page=article&item=linux-417-power&num=1)

~~~
typon
> 10-20%

That's insane. Does this apply to _all_ laptops running Linux?

~~~
progval
> while idle

Which never happens on laptops because of the web browser /s

~~~
kitsunesoba
I wonder if the time has come to add user-configurable resource consumption
throttles to browsers, eg. settings for max CPU, max FPS (foreground and
background) for developer-triggered redraws, etc. On my laptops I’d have it
ratcheted all the way down, because not needing to plug in and my lap not
being cooked is more important than whatever frills the websites I visit have.
And if some site can’t run properly while throttled, well, there’s probably a
more lightweight alternative I should be using instead.

~~~
progval
You can do that with ulimit. But it affects the whole browser, so it is not
very granular. Tab-specific and/or domain-specific resource management would
be more useful.

~~~
vorbote
If using Firefox, I'm very happy using "Auto Tab Discard". It does what you
want.

------
mabbo
> we actually removed more lines than we added

My best year, I removed 10,000 lines of code more than I added without
removing any functionality from the project (and in fact adding some new
features). It isn't always a good thing to do this- but when it is, you know
it as soon as you start reading the code.

I often wish I could be paid _just_ to refactor and rewrite existing code
bases to make them more maintainable.

~~~
kerkeslager
> I often wish I could be paid just to refactor and rewrite existing code
> bases to make them more maintainable.

Yeah, me too--I'm very good at it and it's quite satisfying. Unfortunately
it's very hard to communicate the business value of it (although the business
value is huge in some cases).

~~~
tclancy
Give me a ring if you all ever find a place that lets us use our powers to
their fullest. I feel like realizing removing more code that you put back is
usually a good thing is a tipping point in a coder's career.

~~~
imiric
Ironically, programmers should strive to write the least amount of code as
possible, while reading as much code as possible.

If we can solve a problem without writing _any_ code at all, then that's the
most maintainable and bug free solution.

See "The Best Code is No Code At All": [https://blog.codinghorror.com/the-
best-code-is-no-code-at-al...](https://blog.codinghorror.com/the-best-code-is-
no-code-at-all/) .

~~~
schoen
See also smr.c from
[http://www.ioccc.org/years.html#1994](http://www.ioccc.org/years.html#1994)
(the world's shortest quine!).

~~~
disgruntledphd2
That may be one of the best things I've seen all week.

------
codetrotter
As someone that has a full copy of the license in each of his source files, I
found this the most interesting:

> we also got rid of some copyright language boiler-plate in favor of just the
> spdx lines

So I looked up spdx.

[https://spdx.org/using-spdx](https://spdx.org/using-spdx)

I’m going to start using this too.

~~~
woliveirajr
I understood that SPDX can easily be used in new projects, for example.

But when an earlier project has a license that explicitly states something
like "The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Software.", can you replace it by
a single SPDX link?

I think that technology allows you to easily link something on the internet
instead of providing a offline text file, but is it lawful? And justifiable,
since having _n_ text files saying one thing is easily compressable ?

Got me thinking about it, does removing lines-of-not-code does really make it
smaller or just a little

~~~
codetrotter
For my own code I will use spdx references in the source code files but still
have a LICENSE file in the repo root like I already do with the full text of
the license.

IANAL so I can’t say what you legally can and cannot do with other people’s
code but I would _think_ that placing a copy of each of the licenses used by
others in your repo and name them as LICENSE_THIRDPARTY_MIT,
LICENSE_THIRDPARTY_GPL, etc and mention in your README that these correspond
to the spdx references found in source files would mean that you were still in
compliance.

As for the question “does removing lines of not-code make the file smaller or
just a little”; it does not reduce the SLOC count of course. Personally I just
find the idea of spdx appealing because it means that when I open files to
edit them I don’t have to scroll past a lot of license text first.
Additionally scanning source files for what license is being used will be
simplified.

------
ausjke
"The architectures that are gone are blackfin, cris, frv, m32r, metag,mn10300,
score, and tile. And the new architecture is the nds32 (Andes Technology
32-0bit RISC architecture)."

here is the list of survivors:
[https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/lin...](https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/arch?h=v4.17-rc1)

after 4.17.rc-1 linux still supports 23 archs.

------
irishcoffee
So I understand the whole "SLOC doesn't always need to be positive to have
made useful contributions to a codebase" thing, I do it fairly frequently.
However, is the argument for removing support ("known working good code"), aka
functionality, a good thing? Do people now need to draw a line in the sand and
say: If I want to put linux on my m32r sound mixer, I can't use a kernel newer
than 4.16?

I'm not really sure I'm arguing for or against the dropping of support, more
just curious about others thoughts.

~~~
BlackFingolfin
The problem is that often enough it is _not_ "known working good code",
because nobody has been compiling and/or running and/or stress testing this
code for a long time. Given that constant churn in the kernel, refactoring of
APIs etc., it's quite likely that subtle (or not so subtle) breakages creep
into that code over time. (Even if people who perform this refactoring try to
update these archs, too; or perhaps I should say: "especially if", because
usually you can't test them, after all).

Leaving it in gives the wrong impression that this is "known working good
code", which is one reason to remove it. Another is that removing them makes
it easier to be agile and refactor things, because you don't have to worry
about these archs anymore.

~~~
rbanffy
> because usually you can't test them

We _should_ be able to test that code. We could if, in order for an
architecture/piece of hardware to be considered for inclusion, there were a
software-based emulation tool that could be used to run a full-set of tests
against a kernel build.

It's a lot of work to produce that and to write such a test suite, but it can
grow incrementally. We have very good (and reasonably precise) emulators for a
lot of the PC and mobile space and having those running would give us a lot of
confidence in what we are doing.

~~~
majewsky
So you want to write a new emulator each time Intel releases a new chip? I
think you're vastly underestimating the scale of this task.

Video game emulators are possible because there is only one (or a very small
number of) hardware configuration(s) for each console. Emulators for mobile
development are possible because they simulate only the APIs, not the actual
physical hardware, down to the level of interrupts and registers.

~~~
rbanffy
I don't think x86 would be a particularly attractive target for emulation in
this case - x86 hardware is readily available and testing is much easier than,
say, SuperH or H8.

Intel probably has internal tools that (somewhat) precisely emulate their
chips and it'd probably be very hard to persuade them to share, but they seem
committed to make sure Linux runs well on their gear, so it's probably not a
huge problem.

I think of this as a way to keep the supported architectures as supported as
possible even when actual hardware is not readily/easily (or yet) available
for testing. One day, when x86 is not as easy to come by as today, it could
prove useful.

It's good to keep the software running on more than one platform, as it
exposes some bugs that can easily elude us. Also, emulators offer the best
possible observability for debugging. If they are cycle-accurate then, it's a
dream come true.

------
nimbius
sure, Linus announces more lines of code were removed than added and the crowd
goes wild, but when I do it people are all "who broke the build" and "how is
the repository totally empty again."

------
aylons
I am mildly surprised that Blackfin support has been dropped. A few years ago,
many digital cameras had a Blackfin for both GUI and DSP. I remember working
with SHARC (harvard-architecture CPU from Analog Devices) and seeing the main
advantage of Blackfin being that it could run Linux and, supposedly, being
better equipped to run a complete GUI with several applications. I expected AD
to take advantage of this and support Linux for some time, but instead, it
rotted. Good thing I did not went through this route.

Also, I guess the architectures pruning was one reason he decided not to go
with the 5.0 version. It would give even more meaning to the version number.

~~~
pm215
[http://lkml.iu.edu/hypermail/linux/kernel/1801.1/04345.html](http://lkml.iu.edu/hypermail/linux/kernel/1801.1/04345.html)
has more detail on the dropping of Blackfin support in particular.

~~~
aylons
Interesting. I'm a bit removed from DSPs for some time, I wonder which multi-
core processors AD are talking about. Are these just common ARM and the like
or do they have some new architecture in the pipeline I haven't heard about?

------
ythn
I wish it said that kind of thing in the changelogs more often (in general). I
would be much more eager to download updates if I knew the app was getting
slimmer, and not fatter.

On a side note, I'm annoyed Skype now forcibly updates itself on app launch. I
have no idea how big that app is getting but I just assume it's slowly getting
bigger and bigger.

~~~
JoachimSchipper
To be fair to Linux, it does support an ever-growing list of hardware. It’s
not exactly lean, but continually increasing in size is hard to avoid in its
case...

~~~
AnIdiotOnTheNet
That could have been avoided if they hadn't been so insistent on all drivers
being part of the kernel.

Then again, for as much trouble as that policy causes it is difficult to argue
with its success, since Linux supports more hardware than any other open
source OS and most proprietary ones too (or all, depending on how you count
ancient hardware).

------
famousactress
Deletion is the only perfect code change.

~~~
svag
To quote de Saint Exupéry "...perfection is finally attained not when there is
no longer anything to add, but when there is no longer anything to take
away..."

