Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 8 years ago.
Improve this question
Can anybody explain me the algorithm involved in Memory de-duplication in the Linux kernel
https://www.ibm.com/developerworks/library/l-kernel-shared-memory/
I am finding it difficult to understand and implement it. Can anybody explain me this in simple steps.
The article you've linked appears to be fairly simple as it is.
Application advises kernel (using madvise() syscall) that certain region of its memory may contain duplicate pages.
ksmd adds the pages in this region to a "volatile list" (tree actually, for ease of later look up). "Volatile" means that the pages are still likely to change.
For each page in "volatile" list a checksum is computed. ksmd will scan all the pages in the list every now and then to see if checksum had changed. If it's indeed different every time, nothing has to be done (page is still "volatile").
If, after some number of scans ksmd notices that a checksum for some particular page stopped changing between iterations (page had "stabilized"), it can be put on a "stable" list.
ksmd will scan all existing pages in the "stable" list to see if there is a page already which matches the content of the candidate page. If such page is found, then the candidate page is discarded, and existing page from the "stable" list is mapped in its place as read only (and the associated reference count for the stable page is incremented).
If there are now matching pages in the "stable" list, then candidate page is marked as "read only" and moved from "volatile" list to a stable one.
If application tries to modify a "stable" page it will hit a "protection error" inside kernel. The error handler will invoke ksmd to check whether the page is on its "stable" list. If yes, it will make a writable copy of that page and tuck it back to the "volatile" list, unmapping the "stable" page from the application address space and decrementing "stable" page's reference count (if count hits 0 at this stage, the "stable" page is freed).
Related
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 2 years ago.
Improve this question
When I browse any page, Inspect element appear in screen. Console shows some error code like,
403, 404, 400.It happened every single minute. Even when I write my question in stack overflow, it appears four or five times. It's impact in my device too. It's really disgusting, it hampers my workflow.
I really need your help.
The classic 404-error is annoying for webmasters and users. If 404-errors accumulate, this can be a sign for users and search engines that the website is badly maintained. 404 errors can be identified using a number of tools, for example the Google Search Console, or the Ryte Suite.
It is also advisable to create a special 404 error page so that usability is not affected.
Humor is often used on 404-error pages, or a search bar to animate users and encourage them to search for the desired content on the target page.
A 404 error page should contain the following elements:
Polite or humorous apology for the mistake
Alternatives to the desired page, the desired product (for example, online stores), or alternative articles (such as blogs)
Option for the user to report the error so that it can be removed
Direct reference to the main navigation
A separate search bar to search for further content
Design of the error page to conform to the corporate design so that it is not perceived as a foreign object
Contact options
If you manage to keep the visitor on your website despite a 404-error page, the purpose of a proper 404-error page would be achieved and it would decrease the bounce rate and possibly still make a conversion.
Source
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 3 years ago.
Improve this question
By default, the ext2/3/4 fs reserves 5% of its capacity to be able to keep running when diskspace is getting low.
I also believe it has something to do with allowing "fragmentation between files" or something like this (I haven't been able to find concrete information about this, and I'm kinda newbie in this domain).
My question is: when do we need to keep these 5%, when can we reduce it to something like 1-2%, or when can we remove it totally ?
The elements that I'm considering atm are the following:
The 5% rule was decided something like 20 years ago when the reserved size wasn't way more than ~100Mbs, which is totally different now; if we're only talking about space needed to execute commands and such, do we really need 20Gbs ?
Could it ever be a good idea to remove this allowed space ? If some of it is needed for "fragmentation" somehow, I believe we should at least keep 1-2% available
Is this space really only useful for partitions that are related in any way to root ? I mean, if we have a partition for some folder in /home (something personal, or data from a database, something else that is not related in any way to the OS), this space may not be needed
I've only seen more and more articles on the web telling about how to reduce the reserved blocks so I believe that it may not be a bad idea 100% of the time, but I've not really been able to have articles explaining deeply the concrete application of "when it can / cannot be used", and "what it exactly does and implies".
So if some of you could provide comprehensive information (as well as a simple answer to the question I exposed above) I would be very thankful.
Those 5% are really kept for root user to be able to login and do some operations in case of full filesystem. And yes, you can decrease the amount (I did this in the past) to 1-2% (depend of the disk size). But be aware for most filesystems this should be defined when you create it and its hard (if possible at all) to change it after.
About zero it - yes, that's also possible. But will be wise to keep some space for root in the /, /root (or whatever is the home of root user), /tmp and eventually /var/tmp
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 3 years ago.
Improve this question
According to kernel.org there is the possibility to store dentries in trees instead of lists but you need to enable this flag (EXT4_INDEX_FL) in the inode structure. I this enabled by default or I have to format my partition with some flags?
I need to store lots of small files (same old problem) of about 130k each and I understood that this will help to speed up lookup and also that it is recommended to store those files in a 2 level directories hierarchy. Is there something else I need to consider so that this doesn't blow up if want to store something close to 60.000.000 of this kind of files ? (maybe some other values for block size, number of blocks in a group)
This option is referred to by the e2fsprogs suite as dir_index. It's enabled by default, and you can verify that it's enabled on a file system by running tune2fs -l DEVICE as root.
It is indeed recommended that you shard your files manually so that you don't have a huge number of files in the same directory. While using B-trees makes the operation O(log n) instead of O(n), for large numbers of files, the operation can still be expensive.
If you know you're going to be creating a large number of files, you can set the inode ratio to 4096 with the -i option; this will create a larger number of inodes so that you can hold more files. You can also see common settings for a large number of situations in /etc/mke2fs.conf.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 9 years ago.
Improve this question
What would happen if the Linux kernel deleted itself? Will there be a moment when it could no longer delete files because rm or the program used for deletion has been deleted too?
Regards.
The question is (apart from being off-topic) somewhat wrong in itself, as rm is not part of the kernel, but either a shell built-in or a separate user-level program. Admittedly, rm uses a syscall provided by the kernel, but that is irrelevant.
The kernel itself is loaded from a compressed image and locked in RAM. It does not matter whether you delete the compressed image until you reboot (which will fail with the boot loader giving you a message like "vmlinuz not found"). You have no way of removing the kernel from RAM (well, other than rebooting...).
Also, for the most part, it does not even matter whether you delete a file, including a running program's executable anyway (if we may be so daunting as to call the kernel a "program" for a moment) under Linux, because deleting a file merely removes the link, not the file. It is a Windows-typical assumption that deleting a file does evil, destructive things.
Under Unix-like systems, it is perfectly possible to delete (or replace) a program while it is running, and it will not cause any problems at all. You will remove the name in the filesystem, that's all. Any open descriptors will remain valid until the last one is closed, the original file will stay intact as-is for any observer who obtained a handle earlier, and it will be "gone" for everyone trying to get at it later.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 5 years ago.
Improve this question
Like the title says, is there a way to sort all tasks within swimlanes by priority?
I thought you could do this via the search box up top by putting something like:
order by: priority
however it didn't seem to do anything (I used the auto complete bits so it seemed right)?
As currently we have critical bugs down the bottom and minor cosmetics at the top and we dont want to have to keep manually sorting them for developers to pick up.
This is not quite what you are looking for, but may serve a similar purpose:
Create a board specifically for dealing with priorities -- I call mine "Priority Board".
Set the swimlane type to 'attribute'
Set the "Field to identify swimlane" to "Priority"
Checkmark all values in the "Field Values To Identify Swimlane" drop box, and click 'apply'
VoilĂ - Drag tasks between swimlanes to set their priority, and you have a nice clear view of the priorities and current state of various tasks -- unfortunately, their swimlanes in the normal view may not be so obvious.
Alternatively, you can set the field for color-coded cards to the 'priority' field. Not quite the same as sorting, but still visually obvious.
Grofit,
It's impossible to sort tasks by priority inside swimlane.
So you can only sort thru all swimlanes.
Also, I would like to recommend you to use following query another time, if you need to sort by priority:
sort by: Priority