Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1220582

Re: [PATCH] zram: don't copy invalid compression algorithms

From Minchan Kim <minchan@kernel.org>
Newsgroups linux.kernel
Subject Re: [PATCH] zram: don't copy invalid compression algorithms
Date 2015-09-08 10:20 +0200
Message-ID <q6mie-72x-5@gated-at.bofh.it> (permalink)
References (2 earlier) <q6fJM-5Z2-3@gated-at.bofh.it> <q6g39-6ln-11@gated-at.bofh.it> <q6gmu-6J6-7@gated-at.bofh.it> <q6jaG-2po-13@gated-at.bofh.it> <q6jkl-2Qh-1@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Tue, Sep 08, 2015 at 02:04:42PM +0900, Sergey Senozhatsky wrote:
> On (09/08/15 13:50), Minchan Kim wrote:
> [..]
> > And it's straightforward/consistent to change the thing's state
> > only if is successful.
> > 
> 
> what for? I provided several good reasons not to do this, because

Several good reasons?

I just heard you claim to take care of scripts which don't check
function's success at the moment function is called but check it
later via reading the knob later.
If we changes it, it breaks such scripts.
So, with your claim, there are two assumption.

1. script doesn't check return val at the moment function completes
2. Instead, script checks it later via reading the knob again.
So, conclusion is we should keep wrong input in kernel side for them.

It seems you insist on "we should keep wrong input from the userspace
in the kernel to show it if user *might* ask for his debug later"
What makes you think like above?

I think such assumption is really from your brain, not real usecases.
Ok, I admit i'm not a god but if there is such thing in real practice,
we should help them to *correct* it rather than keeping such weired
thing. From the beginning, they should check his action's result with
return value, not dmesg, not reading the knob later, again.

> it makes life easier for users. we added this check in Jun 25, 2015

No, it could make more bad scripts which not checks the result
of the action but rely on current awkward zram's interface.
Consider other knobs in the kernel. A few things popped from my mind
at the moment.

/sys/block/sdb/queue/scheduler
/sys/kernel/mm/transparent_hugepage/enabled
/sys/kernel/debug/tracing/current_tracer
/sys/devices/system/clocksource/clocksource/clocksource0/current_clocksource

They are not showing wrong input user have passed although it was failed.
Could you say a example of kernel interface did intentionally like you said?

> while this functionality and scripts have been around for years, and
> apparently now it's users' problem and they must go and do something.

I believe anyone shouldn't rely on it. But who knows?
However, I want to make it sane(ie, only change compressor name
if the action is successful).
Please, let's discuss how we do it rather than whether it's useful
or not.

> 
> 
> seriously, what improvement this change brings in the first place?
> what does it make better and for whom?

As I mentioned, it makes zram's ABI consistent with others
in kernel space so it makes user feel zram is straight-forward
and sane like others.


> 
> 	-ss
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH] zram: don't copy invalid compression algorithms Luis Henriques <luis.henriques@canonical.com> - 2015-09-07 22:50 +0200
  Re: [PATCH] zram: don't copy invalid compression algorithms Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com> - 2015-09-08 02:00 +0200
    Re: [PATCH] zram: don't copy invalid compression algorithms Minchan Kim <minchan@kernel.org> - 2015-09-08 03:20 +0200
      Re: [PATCH] zram: don't copy invalid compression algorithms Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com> - 2015-09-08 03:40 +0200
        Re: [PATCH] zram: don't copy invalid compression algorithms Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com> - 2015-09-08 04:00 +0200
          Re: [PATCH] zram: don't copy invalid compression algorithms Minchan Kim <minchan@kernel.org> - 2015-09-08 07:00 +0200
            Re: [PATCH] zram: don't copy invalid compression algorithms Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com> - 2015-09-08 07:10 +0200
              Re: [PATCH] zram: don't copy invalid compression algorithms Minchan Kim <minchan@kernel.org> - 2015-09-08 10:20 +0200
                Re: [PATCH] zram: don't copy invalid compression algorithms Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com> - 2015-09-08 12:00 +0200
                Re: [PATCH] zram: don't copy invalid compression algorithms Minchan Kim <minchan@kernel.org> - 2015-09-08 15:40 +0200
                Re: [PATCH] zram: don't copy invalid compression algorithms Sergey Senozhatsky <sergey.senozhatsky@gmail.com> - 2015-09-08 15:50 +0200
                Re: [PATCH] zram: don't copy invalid compression algorithms Minchan Kim <minchan@kernel.org> - 2015-09-08 16:30 +0200
                Re: [PATCH] zram: don't copy invalid compression algorithms Sergey Senozhatsky <sergey.senozhatsky@gmail.com> - 2015-09-08 17:40 +0200
                Re: [PATCH] zram: don't copy invalid compression algorithms Luis Henriques <luis.henriques@canonical.com> - 2015-09-08 12:10 +0200
                Re: [PATCH] zram: don't copy invalid compression algorithms Sergey Senozhatsky <sergey.senozhatsky@gmail.com> - 2015-09-08 14:30 +0200
            Re: [PATCH] zram: don't copy invalid compression algorithms Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com> - 2015-09-08 07:20 +0200

csiph-web