[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: /tmp as tmpfs and consequence for imaging software

On Tue, 15 Nov 2011 07:41:54 +0100
Andrew Shadura <bugzilla@tut.by> wrote:

> Hello,
> On Mon, 14 Nov 2011 00:14:18 +0100
> Josselin Mouette <joss@debian.org> wrote:
> > > No it does not work like you said. We know the matrix structure, not
> > > the kernel. We map and unmap manually. Doing as you said is
> > > inneficient and trash a lot cache and so on.
> > This is getting insane. Please learn how to use madvise and
> > posix_fadvise and let the kernel deal with paging. The kernel knows
> > everything about the underlying hardware; the application does not.
> And what about the software being cross-platform? What about other
> systems which don't have such system calls?

Ever heard of #ifdef #else #endif ?

If similar calls exist, use them conditionally. Where they do not
exist, you need to decide if that system can be supported and accept
the limitations of doing so. Where the calls DO exist it is inexcusable
NOT to use the support available.

Do not cripple all platforms with the sins of the weakest.

> Also, the application
> doesn't need to know anything about the hardware except that disk
> memory is usually larger and slower than RAM is.

For a trivial application, that is true. For any application which
makes specific or unusual demands on the hardware / system resources, it
is not. Applications making specific or unusual demands MUST allow for
system differences and that includes adjusting to those which can
handle the requests *better* than your own code as well as providing
code for (or preventing a build / deployment on) those which cannot.

Some kinds of applications just cannot avoid a direct interface with
the kernel (anything using iptables, for example) and any process which
makes unusual demands on the available temporary storage is certainly
sufficiently specialised to require conditionals in the code which make
use of kernel features where those are available.

Cross-platform is not an excuse for one-class-for-all. Cross-platform
means making the most of each platform, not dumbing down to the lowest,
meanest or most inept.

If you want compile-once run anywhere, you could try java and move all
these problems to the VM. (Which has to do this system-specific stuff

If the application needs to be recompiled to be cross-platform then
there is absolutely NO EXCUSE for not including conditional compilation
for specific kernels or environments.

Your build system is unquestionably doing some adjustments from one
platform to another anyway - you simply have to bring those
conditionals into the codebase. There is no excuse - your software is
broken and it must be fixed or removed.

(and, yes, I've explicitly included iptables as an example because I've
got an RC bug outstanding for a tiny app which cannot therefore be used
on BSD and I keep meaning to find the time to fix the build
requirements, so this is directed at me as much as anyone else.)


Neil Williams

Attachment: pgpx9PTxvdgdu.pgp
Description: PGP signature

Reply to: