You've already forked linux-apfs
mirror of
https://github.com/linux-apfs/linux-apfs.git
synced 2026-05-01 15:00:59 -07:00
Merge branch 'akpm-incoming-1'
* akpm-incoming-1: (176 commits) scripts/checkpatch.pl: add check for declaration of pci_device_id scripts/checkpatch.pl: add warnings for static char that could be static const char checkpatch: version 0.31 checkpatch: statement/block context analyser should look at sanitised lines checkpatch: handle EXPORT_SYMBOL for DEVICE_ATTR and similar checkpatch: clean up structure definition macro handline checkpatch: update copyright dates checkpatch: Add additional attribute #defines checkpatch: check for incorrect permissions checkpatch: ensure kconfig help checks only apply when we are adding help checkpatch: simplify and consolidate "missing space after" checks checkpatch: add check for space after struct, union, and enum checkpatch: returning errno typically should be negative checkpatch: handle casts better fixing false categorisation of : as binary checkpatch: ensure we do not collapse bracketed sections into constants checkpatch: suggest cleanpatch and cleanfile when appropriate checkpatch: types may sit on a line on their own checkpatch: fix regressions in "fix handling of leading spaces" div64_u64(): improve precision on 32bit platforms lib/parser: cleanup match_number() ...
This commit is contained in:
@@ -374,13 +374,13 @@ Swap: 0 kB
|
||||
KernelPageSize: 4 kB
|
||||
MMUPageSize: 4 kB
|
||||
|
||||
The first of these lines shows the same information as is displayed for the
|
||||
mapping in /proc/PID/maps. The remaining lines show the size of the mapping,
|
||||
the amount of the mapping that is currently resident in RAM, the "proportional
|
||||
set size” (divide each shared page by the number of processes sharing it), the
|
||||
number of clean and dirty shared pages in the mapping, and the number of clean
|
||||
and dirty private pages in the mapping. The "Referenced" indicates the amount
|
||||
of memory currently marked as referenced or accessed.
|
||||
The first of these lines shows the same information as is displayed for the
|
||||
mapping in /proc/PID/maps. The remaining lines show the size of the mapping
|
||||
(size), the amount of the mapping that is currently resident in RAM (RSS), the
|
||||
process' proportional share of this mapping (PSS), the number of clean and
|
||||
dirty shared pages in the mapping, and the number of clean and dirty private
|
||||
pages in the mapping. The "Referenced" indicates the amount of memory
|
||||
currently marked as referenced or accessed.
|
||||
|
||||
This file is only present if the CONFIG_MMU kernel configuration option is
|
||||
enabled.
|
||||
|
||||
@@ -0,0 +1,111 @@
|
||||
Kernel driver apds990x
|
||||
======================
|
||||
|
||||
Supported chips:
|
||||
Avago APDS990X
|
||||
|
||||
Data sheet:
|
||||
Not freely available
|
||||
|
||||
Author:
|
||||
Samu Onkalo <samu.p.onkalo@nokia.com>
|
||||
|
||||
Description
|
||||
-----------
|
||||
|
||||
APDS990x is a combined ambient light and proximity sensor. ALS and proximity
|
||||
functionality are highly connected. ALS measurement path must be running
|
||||
while the proximity functionality is enabled.
|
||||
|
||||
ALS produces raw measurement values for two channels: Clear channel
|
||||
(infrared + visible light) and IR only. However, threshold comparisons happen
|
||||
using clear channel only. Lux value and the threshold level on the HW
|
||||
might vary quite much depending the spectrum of the light source.
|
||||
|
||||
Driver makes necessary conversions to both directions so that user handles
|
||||
only lux values. Lux value is calculated using information from the both
|
||||
channels. HW threshold level is calculated from the given lux value to match
|
||||
with current type of the lightning. Sometimes inaccuracy of the estimations
|
||||
lead to false interrupt, but that doesn't harm.
|
||||
|
||||
ALS contains 4 different gain steps. Driver automatically
|
||||
selects suitable gain step. After each measurement, reliability of the results
|
||||
is estimated and new measurement is trigged if necessary.
|
||||
|
||||
Platform data can provide tuned values to the conversion formulas if
|
||||
values are known. Otherwise plain sensor default values are used.
|
||||
|
||||
Proximity side is little bit simpler. There is no need for complex conversions.
|
||||
It produces directly usable values.
|
||||
|
||||
Driver controls chip operational state using pm_runtime framework.
|
||||
Voltage regulators are controlled based on chip operational state.
|
||||
|
||||
SYSFS
|
||||
-----
|
||||
|
||||
|
||||
chip_id
|
||||
RO - shows detected chip type and version
|
||||
|
||||
power_state
|
||||
RW - enable / disable chip. Uses counting logic
|
||||
1 enables the chip
|
||||
0 disables the chip
|
||||
lux0_input
|
||||
RO - measured lux value
|
||||
sysfs_notify called when threshold interrupt occurs
|
||||
|
||||
lux0_sensor_range
|
||||
RO - lux0_input max value. Actually never reaches since sensor tends
|
||||
to saturate much before that. Real max value varies depending
|
||||
on the light spectrum etc.
|
||||
|
||||
lux0_rate
|
||||
RW - measurement rate in Hz
|
||||
|
||||
lux0_rate_avail
|
||||
RO - supported measurement rates
|
||||
|
||||
lux0_calibscale
|
||||
RW - calibration value. Set to neutral value by default.
|
||||
Output results are multiplied with calibscale / calibscale_default
|
||||
value.
|
||||
|
||||
lux0_calibscale_default
|
||||
RO - neutral calibration value
|
||||
|
||||
lux0_thresh_above_value
|
||||
RW - HI level threshold value. All results above the value
|
||||
trigs an interrupt. 65535 (i.e. sensor_range) disables the above
|
||||
interrupt.
|
||||
|
||||
lux0_thresh_below_value
|
||||
RW - LO level threshold value. All results below the value
|
||||
trigs an interrupt. 0 disables the below interrupt.
|
||||
|
||||
prox0_raw
|
||||
RO - measured proximity value
|
||||
sysfs_notify called when threshold interrupt occurs
|
||||
|
||||
prox0_sensor_range
|
||||
RO - prox0_raw max value (1023)
|
||||
|
||||
prox0_raw_en
|
||||
RW - enable / disable proximity - uses counting logic
|
||||
1 enables the proximity
|
||||
0 disables the proximity
|
||||
|
||||
prox0_reporting_mode
|
||||
RW - trigger / periodic. In "trigger" mode the driver tells two possible
|
||||
values: 0 or prox0_sensor_range value. 0 means no proximity,
|
||||
1023 means proximity. This causes minimal number of interrupts.
|
||||
In "periodic" mode the driver reports all values above
|
||||
prox0_thresh_above. This causes more interrupts, but it can give
|
||||
_rough_ estimate about the distance.
|
||||
|
||||
prox0_reporting_mode_avail
|
||||
RO - accepted values to prox0_reporting_mode (trigger, periodic)
|
||||
|
||||
prox0_thresh_above_value
|
||||
RW - threshold level which trigs proximity events.
|
||||
@@ -0,0 +1,116 @@
|
||||
Kernel driver bh1770glc
|
||||
=======================
|
||||
|
||||
Supported chips:
|
||||
ROHM BH1770GLC
|
||||
OSRAM SFH7770
|
||||
|
||||
Data sheet:
|
||||
Not freely available
|
||||
|
||||
Author:
|
||||
Samu Onkalo <samu.p.onkalo@nokia.com>
|
||||
|
||||
Description
|
||||
-----------
|
||||
BH1770GLC and SFH7770 are combined ambient light and proximity sensors.
|
||||
ALS and proximity parts operates on their own, but they shares common I2C
|
||||
interface and interrupt logic. In principle they can run on their own,
|
||||
but ALS side results are used to estimate reliability of the proximity sensor.
|
||||
|
||||
ALS produces 16 bit lux values. The chip contains interrupt logic to produce
|
||||
low and high threshold interrupts.
|
||||
|
||||
Proximity part contains IR-led driver up to 3 IR leds. The chip measures
|
||||
amount of reflected IR light and produces proximity result. Resolution is
|
||||
8 bit. Driver supports only one channel. Driver uses ALS results to estimate
|
||||
reliability of the proximity results. Thus ALS is always running while
|
||||
proximity detection is needed.
|
||||
|
||||
Driver uses threshold interrupts to avoid need for polling the values.
|
||||
Proximity low interrupt doesn't exists in the chip. This is simulated
|
||||
by using a delayed work. As long as there is proximity threshold above
|
||||
interrupts the delayed work is pushed forward. So, when proximity level goes
|
||||
below the threshold value, there is no interrupt and the delayed work will
|
||||
finally run. This is handled as no proximity indication.
|
||||
|
||||
Chip state is controlled via runtime pm framework when enabled in config.
|
||||
|
||||
Calibscale factor is used to hide differences between the chips. By default
|
||||
value set to neutral state meaning factor of 1.00. To get proper values,
|
||||
calibrated source of light is needed as a reference. Calibscale factor is set
|
||||
so that measurement produces about the expected lux value.
|
||||
|
||||
SYSFS
|
||||
-----
|
||||
|
||||
chip_id
|
||||
RO - shows detected chip type and version
|
||||
|
||||
power_state
|
||||
RW - enable / disable chip. Uses counting logic
|
||||
1 enables the chip
|
||||
0 disables the chip
|
||||
|
||||
lux0_input
|
||||
RO - measured lux value
|
||||
sysfs_notify called when threshold interrupt occurs
|
||||
|
||||
lux0_sensor_range
|
||||
RO - lux0_input max value
|
||||
|
||||
lux0_rate
|
||||
RW - measurement rate in Hz
|
||||
|
||||
lux0_rate_avail
|
||||
RO - supported measurement rates
|
||||
|
||||
lux0_thresh_above_value
|
||||
RW - HI level threshold value. All results above the value
|
||||
trigs an interrupt. 65535 (i.e. sensor_range) disables the above
|
||||
interrupt.
|
||||
|
||||
lux0_thresh_below_value
|
||||
RW - LO level threshold value. All results below the value
|
||||
trigs an interrupt. 0 disables the below interrupt.
|
||||
|
||||
lux0_calibscale
|
||||
RW - calibration value. Set to neutral value by default.
|
||||
Output results are multiplied with calibscale / calibscale_default
|
||||
value.
|
||||
|
||||
lux0_calibscale_default
|
||||
RO - neutral calibration value
|
||||
|
||||
prox0_raw
|
||||
RO - measured proximity value
|
||||
sysfs_notify called when threshold interrupt occurs
|
||||
|
||||
prox0_sensor_range
|
||||
RO - prox0_raw max value
|
||||
|
||||
prox0_raw_en
|
||||
RW - enable / disable proximity - uses counting logic
|
||||
1 enables the proximity
|
||||
0 disables the proximity
|
||||
|
||||
prox0_thresh_above_count
|
||||
RW - number of proximity interrupts needed before triggering the event
|
||||
|
||||
prox0_rate_above
|
||||
RW - Measurement rate (in Hz) when the level is above threshold
|
||||
i.e. when proximity on has been reported.
|
||||
|
||||
prox0_rate_below
|
||||
RW - Measurement rate (in Hz) when the level is below threshold
|
||||
i.e. when proximity off has been reported.
|
||||
|
||||
prox0_rate_avail
|
||||
RO - Supported proximity measurement rates in Hz
|
||||
|
||||
prox0_thresh_above0_value
|
||||
RW - threshold level which trigs proximity events.
|
||||
Filtered by persistence filter (prox0_thresh_above_count)
|
||||
|
||||
prox0_thresh_above1_value
|
||||
RW - threshold level which trigs event immediately
|
||||
@@ -97,6 +97,33 @@ hpet_open_close(int argc, const char **argv)
|
||||
void
|
||||
hpet_info(int argc, const char **argv)
|
||||
{
|
||||
struct hpet_info info;
|
||||
int fd;
|
||||
|
||||
if (argc != 1) {
|
||||
fprintf(stderr, "hpet_info: device-name\n");
|
||||
return;
|
||||
}
|
||||
|
||||
fd = open(argv[0], O_RDONLY);
|
||||
if (fd < 0) {
|
||||
fprintf(stderr, "hpet_info: open of %s failed\n", argv[0]);
|
||||
return;
|
||||
}
|
||||
|
||||
if (ioctl(fd, HPET_INFO, &info) < 0) {
|
||||
fprintf(stderr, "hpet_info: failed to get info\n");
|
||||
goto out;
|
||||
}
|
||||
|
||||
fprintf(stderr, "hpet_info: hi_irqfreq 0x%lx hi_flags 0x%lx ",
|
||||
info.hi_ireqfreq, info.hi_flags);
|
||||
fprintf(stderr, "hi_hpet %d hi_timer %d\n",
|
||||
info.hi_hpet, info.hi_timer);
|
||||
|
||||
out:
|
||||
close(fd);
|
||||
return;
|
||||
}
|
||||
|
||||
void
|
||||
|
||||
@@ -46,7 +46,7 @@ use constant HIGH_KSWAPD_LATENCY => 20;
|
||||
use constant HIGH_KSWAPD_REWAKEUP => 21;
|
||||
use constant HIGH_NR_SCANNED => 22;
|
||||
use constant HIGH_NR_TAKEN => 23;
|
||||
use constant HIGH_NR_RECLAIM => 24;
|
||||
use constant HIGH_NR_RECLAIMED => 24;
|
||||
use constant HIGH_NR_CONTIG_DIRTY => 25;
|
||||
|
||||
my %perprocesspid;
|
||||
@@ -58,11 +58,13 @@ my $opt_read_procstat;
|
||||
my $total_wakeup_kswapd;
|
||||
my ($total_direct_reclaim, $total_direct_nr_scanned);
|
||||
my ($total_direct_latency, $total_kswapd_latency);
|
||||
my ($total_direct_nr_reclaimed);
|
||||
my ($total_direct_writepage_file_sync, $total_direct_writepage_file_async);
|
||||
my ($total_direct_writepage_anon_sync, $total_direct_writepage_anon_async);
|
||||
my ($total_kswapd_nr_scanned, $total_kswapd_wake);
|
||||
my ($total_kswapd_writepage_file_sync, $total_kswapd_writepage_file_async);
|
||||
my ($total_kswapd_writepage_anon_sync, $total_kswapd_writepage_anon_async);
|
||||
my ($total_kswapd_nr_reclaimed);
|
||||
|
||||
# Catch sigint and exit on request
|
||||
my $sigint_report = 0;
|
||||
@@ -104,7 +106,7 @@ my $regex_kswapd_wake_default = 'nid=([0-9]*) order=([0-9]*)';
|
||||
my $regex_kswapd_sleep_default = 'nid=([0-9]*)';
|
||||
my $regex_wakeup_kswapd_default = 'nid=([0-9]*) zid=([0-9]*) order=([0-9]*)';
|
||||
my $regex_lru_isolate_default = 'isolate_mode=([0-9]*) order=([0-9]*) nr_requested=([0-9]*) nr_scanned=([0-9]*) nr_taken=([0-9]*) contig_taken=([0-9]*) contig_dirty=([0-9]*) contig_failed=([0-9]*)';
|
||||
my $regex_lru_shrink_inactive_default = 'lru=([A-Z_]*) nr_scanned=([0-9]*) nr_reclaimed=([0-9]*) priority=([0-9]*)';
|
||||
my $regex_lru_shrink_inactive_default = 'nid=([0-9]*) zid=([0-9]*) nr_scanned=([0-9]*) nr_reclaimed=([0-9]*) priority=([0-9]*) flags=([A-Z_|]*)';
|
||||
my $regex_lru_shrink_active_default = 'lru=([A-Z_]*) nr_scanned=([0-9]*) nr_rotated=([0-9]*) priority=([0-9]*)';
|
||||
my $regex_writepage_default = 'page=([0-9a-f]*) pfn=([0-9]*) flags=([A-Z_|]*)';
|
||||
|
||||
@@ -203,8 +205,8 @@ $regex_lru_shrink_inactive = generate_traceevent_regex(
|
||||
"vmscan/mm_vmscan_lru_shrink_inactive",
|
||||
$regex_lru_shrink_inactive_default,
|
||||
"nid", "zid",
|
||||
"lru",
|
||||
"nr_scanned", "nr_reclaimed", "priority");
|
||||
"nr_scanned", "nr_reclaimed", "priority",
|
||||
"flags");
|
||||
$regex_lru_shrink_active = generate_traceevent_regex(
|
||||
"vmscan/mm_vmscan_lru_shrink_active",
|
||||
$regex_lru_shrink_active_default,
|
||||
@@ -375,6 +377,16 @@ EVENT_PROCESS:
|
||||
my $nr_contig_dirty = $7;
|
||||
$perprocesspid{$process_pid}->{HIGH_NR_SCANNED} += $nr_scanned;
|
||||
$perprocesspid{$process_pid}->{HIGH_NR_CONTIG_DIRTY} += $nr_contig_dirty;
|
||||
} elsif ($tracepoint eq "mm_vmscan_lru_shrink_inactive") {
|
||||
$details = $5;
|
||||
if ($details !~ /$regex_lru_shrink_inactive/o) {
|
||||
print "WARNING: Failed to parse mm_vmscan_lru_shrink_inactive as expected\n";
|
||||
print " $details\n";
|
||||
print " $regex_lru_shrink_inactive/o\n";
|
||||
next;
|
||||
}
|
||||
my $nr_reclaimed = $4;
|
||||
$perprocesspid{$process_pid}->{HIGH_NR_RECLAIMED} += $nr_reclaimed;
|
||||
} elsif ($tracepoint eq "mm_vmscan_writepage") {
|
||||
$details = $5;
|
||||
if ($details !~ /$regex_writepage/o) {
|
||||
@@ -464,8 +476,8 @@ sub dump_stats {
|
||||
|
||||
# Print out process activity
|
||||
printf("\n");
|
||||
printf("%-" . $max_strlen . "s %8s %10s %8s %8s %8s %8s %8s\n", "Process", "Direct", "Wokeup", "Pages", "Pages", "Pages", "Time");
|
||||
printf("%-" . $max_strlen . "s %8s %10s %8s %8s %8s %8s %8s\n", "details", "Rclms", "Kswapd", "Scanned", "Sync-IO", "ASync-IO", "Stalled");
|
||||
printf("%-" . $max_strlen . "s %8s %10s %8s %8s %8s %8s %8s %8s\n", "Process", "Direct", "Wokeup", "Pages", "Pages", "Pages", "Pages", "Time");
|
||||
printf("%-" . $max_strlen . "s %8s %10s %8s %8s %8s %8s %8s %8s\n", "details", "Rclms", "Kswapd", "Scanned", "Rclmed", "Sync-IO", "ASync-IO", "Stalled");
|
||||
foreach $process_pid (keys %stats) {
|
||||
|
||||
if (!$stats{$process_pid}->{MM_VMSCAN_DIRECT_RECLAIM_BEGIN}) {
|
||||
@@ -475,6 +487,7 @@ sub dump_stats {
|
||||
$total_direct_reclaim += $stats{$process_pid}->{MM_VMSCAN_DIRECT_RECLAIM_BEGIN};
|
||||
$total_wakeup_kswapd += $stats{$process_pid}->{MM_VMSCAN_WAKEUP_KSWAPD};
|
||||
$total_direct_nr_scanned += $stats{$process_pid}->{HIGH_NR_SCANNED};
|
||||
$total_direct_nr_reclaimed += $stats{$process_pid}->{HIGH_NR_RECLAIMED};
|
||||
$total_direct_writepage_file_sync += $stats{$process_pid}->{MM_VMSCAN_WRITEPAGE_FILE_SYNC};
|
||||
$total_direct_writepage_anon_sync += $stats{$process_pid}->{MM_VMSCAN_WRITEPAGE_ANON_SYNC};
|
||||
$total_direct_writepage_file_async += $stats{$process_pid}->{MM_VMSCAN_WRITEPAGE_FILE_ASYNC};
|
||||
@@ -489,11 +502,12 @@ sub dump_stats {
|
||||
$index++;
|
||||
}
|
||||
|
||||
printf("%-" . $max_strlen . "s %8d %10d %8u %8u %8u %8.3f",
|
||||
printf("%-" . $max_strlen . "s %8d %10d %8u %8u %8u %8u %8.3f",
|
||||
$process_pid,
|
||||
$stats{$process_pid}->{MM_VMSCAN_DIRECT_RECLAIM_BEGIN},
|
||||
$stats{$process_pid}->{MM_VMSCAN_WAKEUP_KSWAPD},
|
||||
$stats{$process_pid}->{HIGH_NR_SCANNED},
|
||||
$stats{$process_pid}->{HIGH_NR_RECLAIMED},
|
||||
$stats{$process_pid}->{MM_VMSCAN_WRITEPAGE_FILE_SYNC} + $stats{$process_pid}->{MM_VMSCAN_WRITEPAGE_ANON_SYNC},
|
||||
$stats{$process_pid}->{MM_VMSCAN_WRITEPAGE_FILE_ASYNC} + $stats{$process_pid}->{MM_VMSCAN_WRITEPAGE_ANON_ASYNC},
|
||||
$this_reclaim_delay / 1000);
|
||||
@@ -529,8 +543,8 @@ sub dump_stats {
|
||||
|
||||
# Print out kswapd activity
|
||||
printf("\n");
|
||||
printf("%-" . $max_strlen . "s %8s %10s %8s %8s %8s %8s\n", "Kswapd", "Kswapd", "Order", "Pages", "Pages", "Pages");
|
||||
printf("%-" . $max_strlen . "s %8s %10s %8s %8s %8s %8s\n", "Instance", "Wakeups", "Re-wakeup", "Scanned", "Sync-IO", "ASync-IO");
|
||||
printf("%-" . $max_strlen . "s %8s %10s %8s %8s %8s %8s\n", "Kswapd", "Kswapd", "Order", "Pages", "Pages", "Pages", "Pages");
|
||||
printf("%-" . $max_strlen . "s %8s %10s %8s %8s %8s %8s\n", "Instance", "Wakeups", "Re-wakeup", "Scanned", "Rclmed", "Sync-IO", "ASync-IO");
|
||||
foreach $process_pid (keys %stats) {
|
||||
|
||||
if (!$stats{$process_pid}->{MM_VMSCAN_KSWAPD_WAKE}) {
|
||||
@@ -539,16 +553,18 @@ sub dump_stats {
|
||||
|
||||
$total_kswapd_wake += $stats{$process_pid}->{MM_VMSCAN_KSWAPD_WAKE};
|
||||
$total_kswapd_nr_scanned += $stats{$process_pid}->{HIGH_NR_SCANNED};
|
||||
$total_kswapd_nr_reclaimed += $stats{$process_pid}->{HIGH_NR_RECLAIMED};
|
||||
$total_kswapd_writepage_file_sync += $stats{$process_pid}->{MM_VMSCAN_WRITEPAGE_FILE_SYNC};
|
||||
$total_kswapd_writepage_anon_sync += $stats{$process_pid}->{MM_VMSCAN_WRITEPAGE_ANON_SYNC};
|
||||
$total_kswapd_writepage_file_async += $stats{$process_pid}->{MM_VMSCAN_WRITEPAGE_FILE_ASYNC};
|
||||
$total_kswapd_writepage_anon_async += $stats{$process_pid}->{MM_VMSCAN_WRITEPAGE_ANON_ASYNC};
|
||||
|
||||
printf("%-" . $max_strlen . "s %8d %10d %8u %8i %8u",
|
||||
printf("%-" . $max_strlen . "s %8d %10d %8u %8u %8i %8u",
|
||||
$process_pid,
|
||||
$stats{$process_pid}->{MM_VMSCAN_KSWAPD_WAKE},
|
||||
$stats{$process_pid}->{HIGH_KSWAPD_REWAKEUP},
|
||||
$stats{$process_pid}->{HIGH_NR_SCANNED},
|
||||
$stats{$process_pid}->{HIGH_NR_RECLAIMED},
|
||||
$stats{$process_pid}->{MM_VMSCAN_WRITEPAGE_FILE_SYNC} + $stats{$process_pid}->{MM_VMSCAN_WRITEPAGE_ANON_SYNC},
|
||||
$stats{$process_pid}->{MM_VMSCAN_WRITEPAGE_FILE_ASYNC} + $stats{$process_pid}->{MM_VMSCAN_WRITEPAGE_ANON_ASYNC});
|
||||
|
||||
@@ -579,6 +595,7 @@ sub dump_stats {
|
||||
print "\nSummary\n";
|
||||
print "Direct reclaims: $total_direct_reclaim\n";
|
||||
print "Direct reclaim pages scanned: $total_direct_nr_scanned\n";
|
||||
print "Direct reclaim pages reclaimed: $total_direct_nr_reclaimed\n";
|
||||
print "Direct reclaim write file sync I/O: $total_direct_writepage_file_sync\n";
|
||||
print "Direct reclaim write anon sync I/O: $total_direct_writepage_anon_sync\n";
|
||||
print "Direct reclaim write file async I/O: $total_direct_writepage_file_async\n";
|
||||
@@ -588,6 +605,7 @@ sub dump_stats {
|
||||
print "\n";
|
||||
print "Kswapd wakeups: $total_kswapd_wake\n";
|
||||
print "Kswapd pages scanned: $total_kswapd_nr_scanned\n";
|
||||
print "Kswapd pages reclaimed: $total_kswapd_nr_reclaimed\n";
|
||||
print "Kswapd reclaim write file sync I/O: $total_kswapd_writepage_file_sync\n";
|
||||
print "Kswapd reclaim write anon sync I/O: $total_kswapd_writepage_anon_sync\n";
|
||||
print "Kswapd reclaim write file async I/O: $total_kswapd_writepage_file_async\n";
|
||||
@@ -612,6 +630,7 @@ sub aggregate_perprocesspid() {
|
||||
$perprocess{$process}->{MM_VMSCAN_WAKEUP_KSWAPD} += $perprocesspid{$process_pid}->{MM_VMSCAN_WAKEUP_KSWAPD};
|
||||
$perprocess{$process}->{HIGH_KSWAPD_REWAKEUP} += $perprocesspid{$process_pid}->{HIGH_KSWAPD_REWAKEUP};
|
||||
$perprocess{$process}->{HIGH_NR_SCANNED} += $perprocesspid{$process_pid}->{HIGH_NR_SCANNED};
|
||||
$perprocess{$process}->{HIGH_NR_RECLAIMED} += $perprocesspid{$process_pid}->{HIGH_NR_RECLAIMED};
|
||||
$perprocess{$process}->{MM_VMSCAN_WRITEPAGE_FILE_SYNC} += $perprocesspid{$process_pid}->{MM_VMSCAN_WRITEPAGE_FILE_SYNC};
|
||||
$perprocess{$process}->{MM_VMSCAN_WRITEPAGE_ANON_SYNC} += $perprocesspid{$process_pid}->{MM_VMSCAN_WRITEPAGE_ANON_SYNC};
|
||||
$perprocess{$process}->{MM_VMSCAN_WRITEPAGE_FILE_ASYNC} += $perprocesspid{$process_pid}->{MM_VMSCAN_WRITEPAGE_FILE_ASYNC};
|
||||
|
||||
@@ -0,0 +1,162 @@
|
||||
|
||||
====================
|
||||
HIGH MEMORY HANDLING
|
||||
====================
|
||||
|
||||
By: Peter Zijlstra <a.p.zijlstra@chello.nl>
|
||||
|
||||
Contents:
|
||||
|
||||
(*) What is high memory?
|
||||
|
||||
(*) Temporary virtual mappings.
|
||||
|
||||
(*) Using kmap_atomic.
|
||||
|
||||
(*) Cost of temporary mappings.
|
||||
|
||||
(*) i386 PAE.
|
||||
|
||||
|
||||
====================
|
||||
WHAT IS HIGH MEMORY?
|
||||
====================
|
||||
|
||||
High memory (highmem) is used when the size of physical memory approaches or
|
||||
exceeds the maximum size of virtual memory. At that point it becomes
|
||||
impossible for the kernel to keep all of the available physical memory mapped
|
||||
at all times. This means the kernel needs to start using temporary mappings of
|
||||
the pieces of physical memory that it wants to access.
|
||||
|
||||
The part of (physical) memory not covered by a permanent mapping is what we
|
||||
refer to as 'highmem'. There are various architecture dependent constraints on
|
||||
where exactly that border lies.
|
||||
|
||||
In the i386 arch, for example, we choose to map the kernel into every process's
|
||||
VM space so that we don't have to pay the full TLB invalidation costs for
|
||||
kernel entry/exit. This means the available virtual memory space (4GiB on
|
||||
i386) has to be divided between user and kernel space.
|
||||
|
||||
The traditional split for architectures using this approach is 3:1, 3GiB for
|
||||
userspace and the top 1GiB for kernel space:
|
||||
|
||||
+--------+ 0xffffffff
|
||||
| Kernel |
|
||||
+--------+ 0xc0000000
|
||||
| |
|
||||
| User |
|
||||
| |
|
||||
+--------+ 0x00000000
|
||||
|
||||
This means that the kernel can at most map 1GiB of physical memory at any one
|
||||
time, but because we need virtual address space for other things - including
|
||||
temporary maps to access the rest of the physical memory - the actual direct
|
||||
map will typically be less (usually around ~896MiB).
|
||||
|
||||
Other architectures that have mm context tagged TLBs can have separate kernel
|
||||
and user maps. Some hardware (like some ARMs), however, have limited virtual
|
||||
space when they use mm context tags.
|
||||
|
||||
|
||||
==========================
|
||||
TEMPORARY VIRTUAL MAPPINGS
|
||||
==========================
|
||||
|
||||
The kernel contains several ways of creating temporary mappings:
|
||||
|
||||
(*) vmap(). This can be used to make a long duration mapping of multiple
|
||||
physical pages into a contiguous virtual space. It needs global
|
||||
synchronization to unmap.
|
||||
|
||||
(*) kmap(). This permits a short duration mapping of a single page. It needs
|
||||
global synchronization, but is amortized somewhat. It is also prone to
|
||||
deadlocks when using in a nested fashion, and so it is not recommended for
|
||||
new code.
|
||||
|
||||
(*) kmap_atomic(). This permits a very short duration mapping of a single
|
||||
page. Since the mapping is restricted to the CPU that issued it, it
|
||||
performs well, but the issuing task is therefore required to stay on that
|
||||
CPU until it has finished, lest some other task displace its mappings.
|
||||
|
||||
kmap_atomic() may also be used by interrupt contexts, since it is does not
|
||||
sleep and the caller may not sleep until after kunmap_atomic() is called.
|
||||
|
||||
It may be assumed that k[un]map_atomic() won't fail.
|
||||
|
||||
|
||||
=================
|
||||
USING KMAP_ATOMIC
|
||||
=================
|
||||
|
||||
When and where to use kmap_atomic() is straightforward. It is used when code
|
||||
wants to access the contents of a page that might be allocated from high memory
|
||||
(see __GFP_HIGHMEM), for example a page in the pagecache. The API has two
|
||||
functions, and they can be used in a manner similar to the following:
|
||||
|
||||
/* Find the page of interest. */
|
||||
struct page *page = find_get_page(mapping, offset);
|
||||
|
||||
/* Gain access to the contents of that page. */
|
||||
void *vaddr = kmap_atomic(page);
|
||||
|
||||
/* Do something to the contents of that page. */
|
||||
memset(vaddr, 0, PAGE_SIZE);
|
||||
|
||||
/* Unmap that page. */
|
||||
kunmap_atomic(vaddr);
|
||||
|
||||
Note that the kunmap_atomic() call takes the result of the kmap_atomic() call
|
||||
not the argument.
|
||||
|
||||
If you need to map two pages because you want to copy from one page to
|
||||
another you need to keep the kmap_atomic calls strictly nested, like:
|
||||
|
||||
vaddr1 = kmap_atomic(page1);
|
||||
vaddr2 = kmap_atomic(page2);
|
||||
|
||||
memcpy(vaddr1, vaddr2, PAGE_SIZE);
|
||||
|
||||
kunmap_atomic(vaddr2);
|
||||
kunmap_atomic(vaddr1);
|
||||
|
||||
|
||||
==========================
|
||||
COST OF TEMPORARY MAPPINGS
|
||||
==========================
|
||||
|
||||
The cost of creating temporary mappings can be quite high. The arch has to
|
||||
manipulate the kernel's page tables, the data TLB and/or the MMU's registers.
|
||||
|
||||
If CONFIG_HIGHMEM is not set, then the kernel will try and create a mapping
|
||||
simply with a bit of arithmetic that will convert the page struct address into
|
||||
a pointer to the page contents rather than juggling mappings about. In such a
|
||||
case, the unmap operation may be a null operation.
|
||||
|
||||
If CONFIG_MMU is not set, then there can be no temporary mappings and no
|
||||
highmem. In such a case, the arithmetic approach will also be used.
|
||||
|
||||
|
||||
========
|
||||
i386 PAE
|
||||
========
|
||||
|
||||
The i386 arch, under some circumstances, will permit you to stick up to 64GiB
|
||||
of RAM into your 32-bit machine. This has a number of consequences:
|
||||
|
||||
(*) Linux needs a page-frame structure for each page in the system and the
|
||||
pageframes need to live in the permanent mapping, which means:
|
||||
|
||||
(*) you can have 896M/sizeof(struct page) page-frames at most; with struct
|
||||
page being 32-bytes that would end up being something in the order of 112G
|
||||
worth of pages; the kernel, however, needs to store more than just
|
||||
page-frames in that memory...
|
||||
|
||||
(*) PAE makes your page tables larger - which slows the system down as more
|
||||
data has to be accessed to traverse in TLB fills and the like. One
|
||||
advantage is that PAE has more PTE bits and can provide advanced features
|
||||
like NX and PAT.
|
||||
|
||||
The general recommendation is that you don't use more than 8GiB on a 32-bit
|
||||
machine - although more might work for you and your workload, you're pretty
|
||||
much on your own - don't expect kernel developers to really care much if things
|
||||
come apart.
|
||||
+10
-54
@@ -657,7 +657,7 @@ ARM/FARADAY FA526 PORT
|
||||
M: Hans Ulli Kroll <ulli.kroll@googlemail.com>
|
||||
L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
|
||||
S: Maintained
|
||||
T: git://git.berlios.de/gemini-board
|
||||
T: git git://git.berlios.de/gemini-board
|
||||
F: arch/arm/mm/*-fa*
|
||||
|
||||
ARM/FOOTBRIDGE ARCHITECTURE
|
||||
@@ -672,7 +672,7 @@ ARM/FREESCALE IMX / MXC ARM ARCHITECTURE
|
||||
M: Sascha Hauer <kernel@pengutronix.de>
|
||||
L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
|
||||
S: Maintained
|
||||
T: git://git.pengutronix.de/git/imx/linux-2.6.git
|
||||
T: git git://git.pengutronix.de/git/imx/linux-2.6.git
|
||||
F: arch/arm/mach-mx*/
|
||||
F: arch/arm/plat-mxc/
|
||||
|
||||
@@ -710,8 +710,7 @@ ARM/INCOME PXA270 SUPPORT
|
||||
M: Marek Vasut <marek.vasut@gmail.com>
|
||||
L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
|
||||
S: Maintained
|
||||
F: arch/arm/mach-pxa/income.c
|
||||
F: arch/arm/mach-pxa/include/mach-pxa/income.h
|
||||
F: arch/arm/mach-pxa/colibri-pxa270-income.c
|
||||
|
||||
ARM/INTEL IOP32X ARM ARCHITECTURE
|
||||
M: Lennert Buytenhek <kernel@wantstofly.org>
|
||||
@@ -758,13 +757,7 @@ L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
|
||||
S: Maintained
|
||||
F: arch/arm/mach-ixp4xx/
|
||||
|
||||
ARM/INTEL RESEARCH IMOTE 2 MACHINE SUPPORT
|
||||
M: Jonathan Cameron <jic23@cam.ac.uk>
|
||||
L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
|
||||
S: Maintained
|
||||
F: arch/arm/mach-pxa/imote2.c
|
||||
|
||||
ARM/INTEL RESEARCH STARGATE 2 MACHINE SUPPORT
|
||||
ARM/INTEL RESEARCH IMOTE/STARGATE 2 MACHINE SUPPORT
|
||||
M: Jonathan Cameron <jic23@cam.ac.uk>
|
||||
L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
|
||||
S: Maintained
|
||||
@@ -929,40 +922,20 @@ W: http://www.fluff.org/ben/linux/
|
||||
S: Maintained
|
||||
F: arch/arm/mach-s3c2410/
|
||||
|
||||
ARM/S3C2440 ARM ARCHITECTURE
|
||||
ARM/S3C244x ARM ARCHITECTURE
|
||||
M: Ben Dooks <ben-linux@fluff.org>
|
||||
L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
|
||||
W: http://www.fluff.org/ben/linux/
|
||||
S: Maintained
|
||||
F: arch/arm/mach-s3c2440/
|
||||
|
||||
ARM/S3C2442 ARM ARCHITECTURE
|
||||
M: Ben Dooks <ben-linux@fluff.org>
|
||||
L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
|
||||
W: http://www.fluff.org/ben/linux/
|
||||
S: Maintained
|
||||
F: arch/arm/mach-s3c2442/
|
||||
|
||||
ARM/S3C2443 ARM ARCHITECTURE
|
||||
M: Ben Dooks <ben-linux@fluff.org>
|
||||
L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
|
||||
W: http://www.fluff.org/ben/linux/
|
||||
S: Maintained
|
||||
F: arch/arm/mach-s3c2443/
|
||||
|
||||
ARM/S3C6400 ARM ARCHITECTURE
|
||||
ARM/S3C64xx ARM ARCHITECTURE
|
||||
M: Ben Dooks <ben-linux@fluff.org>
|
||||
L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
|
||||
W: http://www.fluff.org/ben/linux/
|
||||
S: Maintained
|
||||
F: arch/arm/mach-s3c6400/
|
||||
|
||||
ARM/S3C6410 ARM ARCHITECTURE
|
||||
M: Ben Dooks <ben-linux@fluff.org>
|
||||
L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
|
||||
W: http://www.fluff.org/ben/linux/
|
||||
S: Maintained
|
||||
F: arch/arm/mach-s3c6410/
|
||||
F: arch/arm/mach-s3c64xx/
|
||||
|
||||
ARM/S5P ARM ARCHITECTURES
|
||||
M: Kukjin Kim <kgene.kim@samsung.com>
|
||||
@@ -3867,7 +3840,7 @@ F: drivers/net/wireless/mwl8k.c
|
||||
MARVELL SOC MMC/SD/SDIO CONTROLLER DRIVER
|
||||
M: Nicolas Pitre <nico@fluxnic.net>
|
||||
S: Odd Fixes
|
||||
F: drivers/mmc/host/mvsdio.*
|
||||
F: drivers/mmc/host/mvsdio.*
|
||||
|
||||
MARVELL YUKON / SYSKONNECT DRIVER
|
||||
M: Mirko Lindner <mlindner@syskonnect.de>
|
||||
@@ -4958,7 +4931,7 @@ RCUTORTURE MODULE
|
||||
M: Josh Triplett <josh@freedesktop.org>
|
||||
M: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
|
||||
S: Supported
|
||||
T: git://git.kernel.org/pub/scm/linux/kernel/git/paulmck/linux-2.6-rcu.git
|
||||
T: git git://git.kernel.org/pub/scm/linux/kernel/git/paulmck/linux-2.6-rcu.git
|
||||
F: Documentation/RCU/torture.txt
|
||||
F: kernel/rcutorture.c
|
||||
|
||||
@@ -4983,7 +4956,7 @@ M: Dipankar Sarma <dipankar@in.ibm.com>
|
||||
M: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
|
||||
W: http://www.rdrop.com/users/paulmck/rclock/
|
||||
S: Supported
|
||||
T: git://git.kernel.org/pub/scm/linux/kernel/git/paulmck/linux-2.6-rcu.git
|
||||
T: git git://git.kernel.org/pub/scm/linux/kernel/git/paulmck/linux-2.6-rcu.git
|
||||
F: Documentation/RCU/
|
||||
F: include/linux/rcu*
|
||||
F: include/linux/srcu*
|
||||
@@ -6141,13 +6114,6 @@ L: linux-usb@vger.kernel.org
|
||||
S: Maintained
|
||||
F: drivers/usb/serial/option.c
|
||||
|
||||
USB OV511 DRIVER
|
||||
M: Mark McClelland <mmcclell@bigfoot.com>
|
||||
L: linux-usb@vger.kernel.org
|
||||
W: http://alpha.dyndns.org/ov511/
|
||||
S: Maintained
|
||||
F: drivers/media/video/ov511.*
|
||||
|
||||
USB PEGASUS DRIVER
|
||||
M: Petko Manolov <petkan@users.sourceforge.net>
|
||||
L: linux-usb@vger.kernel.org
|
||||
@@ -6308,16 +6274,6 @@ S: Supported
|
||||
F: drivers/usb/host/xhci*
|
||||
F: drivers/usb/host/pci-quirks*
|
||||
|
||||
USB ZC0301 DRIVER
|
||||
M: Luca Risolia <luca.risolia@studio.unibo.it>
|
||||
L: linux-usb@vger.kernel.org
|
||||
L: linux-media@vger.kernel.org
|
||||
T: git git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-2.6.git
|
||||
W: http://www.linux-projects.org
|
||||
S: Maintained
|
||||
F: Documentation/video4linux/zc0301.txt
|
||||
F: drivers/media/video/zc0301/
|
||||
|
||||
USB ZD1201 DRIVER
|
||||
L: linux-wireless@vger.kernel.org
|
||||
W: http://linux-lc100020.sourceforge.net
|
||||
|
||||
@@ -55,6 +55,9 @@ config ZONE_DMA
|
||||
bool
|
||||
default y
|
||||
|
||||
config ARCH_DMA_ADDR_T_64BIT
|
||||
def_bool y
|
||||
|
||||
config NEED_DMA_MAP_STATE
|
||||
def_bool y
|
||||
|
||||
|
||||
@@ -247,7 +247,7 @@ struct el_MCPCIA_uncorrected_frame_mcheck {
|
||||
#define vip volatile int __force *
|
||||
#define vuip volatile unsigned int __force *
|
||||
|
||||
#ifdef MCPCIA_ONE_HAE_WINDOW
|
||||
#ifndef MCPCIA_ONE_HAE_WINDOW
|
||||
#define MCPCIA_FROB_MMIO \
|
||||
if (__mcpcia_is_mmio(hose)) { \
|
||||
set_hae(hose & 0xffffffff); \
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
#ifndef __ALPHA_T2__H__
|
||||
#define __ALPHA_T2__H__
|
||||
|
||||
/* Fit everything into one 128MB HAE window. */
|
||||
#define T2_ONE_HAE_WINDOW 1
|
||||
|
||||
#include <linux/types.h>
|
||||
#include <linux/spinlock.h>
|
||||
#include <asm/compiler.h>
|
||||
@@ -19,7 +22,7 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#define T2_MEM_R1_MASK 0x07ffffff /* Mem sparse region 1 mask is 26 bits */
|
||||
#define T2_MEM_R1_MASK 0x07ffffff /* Mem sparse region 1 mask is 27 bits */
|
||||
|
||||
/* GAMMA-SABLE is a SABLE with EV5-based CPUs */
|
||||
/* All LYNX machines, EV4 or EV5, use the GAMMA bias also */
|
||||
@@ -85,7 +88,9 @@
|
||||
#define T2_DIR (IDENT_ADDR + GAMMA_BIAS + 0x38e0004a0UL)
|
||||
#define T2_ICE (IDENT_ADDR + GAMMA_BIAS + 0x38e0004c0UL)
|
||||
|
||||
#ifndef T2_ONE_HAE_WINDOW
|
||||
#define T2_HAE_ADDRESS T2_HAE_1
|
||||
#endif
|
||||
|
||||
/* T2 CSRs are in the non-cachable primary IO space from 3.8000.0000 to
|
||||
3.8fff.ffff
|
||||
@@ -429,13 +434,15 @@ extern inline void t2_outl(u32 b, unsigned long addr)
|
||||
*
|
||||
*/
|
||||
|
||||
#ifdef T2_ONE_HAE_WINDOW
|
||||
#define t2_set_hae
|
||||
#else
|
||||
#define t2_set_hae { \
|
||||
msb = addr >> 27; \
|
||||
unsigned long msb = addr >> 27; \
|
||||
addr &= T2_MEM_R1_MASK; \
|
||||
set_hae(msb); \
|
||||
}
|
||||
|
||||
extern raw_spinlock_t t2_hae_lock;
|
||||
#endif
|
||||
|
||||
/*
|
||||
* NOTE: take T2_DENSE_MEM off in each readX/writeX routine, since
|
||||
@@ -446,28 +453,22 @@ extern raw_spinlock_t t2_hae_lock;
|
||||
__EXTERN_INLINE u8 t2_readb(const volatile void __iomem *xaddr)
|
||||
{
|
||||
unsigned long addr = (unsigned long) xaddr - T2_DENSE_MEM;
|
||||
unsigned long result, msb;
|
||||
unsigned long flags;
|
||||
raw_spin_lock_irqsave(&t2_hae_lock, flags);
|
||||
unsigned long result;
|
||||
|
||||
t2_set_hae;
|
||||
|
||||
result = *(vip) ((addr << 5) + T2_SPARSE_MEM + 0x00);
|
||||
raw_spin_unlock_irqrestore(&t2_hae_lock, flags);
|
||||
return __kernel_extbl(result, addr & 3);
|
||||
}
|
||||
|
||||
__EXTERN_INLINE u16 t2_readw(const volatile void __iomem *xaddr)
|
||||
{
|
||||
unsigned long addr = (unsigned long) xaddr - T2_DENSE_MEM;
|
||||
unsigned long result, msb;
|
||||
unsigned long flags;
|
||||
raw_spin_lock_irqsave(&t2_hae_lock, flags);
|
||||
unsigned long result;
|
||||
|
||||
t2_set_hae;
|
||||
|
||||
result = *(vuip) ((addr << 5) + T2_SPARSE_MEM + 0x08);
|
||||
raw_spin_unlock_irqrestore(&t2_hae_lock, flags);
|
||||
return __kernel_extwl(result, addr & 3);
|
||||
}
|
||||
|
||||
@@ -478,59 +479,47 @@ __EXTERN_INLINE u16 t2_readw(const volatile void __iomem *xaddr)
|
||||
__EXTERN_INLINE u32 t2_readl(const volatile void __iomem *xaddr)
|
||||
{
|
||||
unsigned long addr = (unsigned long) xaddr - T2_DENSE_MEM;
|
||||
unsigned long result, msb;
|
||||
unsigned long flags;
|
||||
raw_spin_lock_irqsave(&t2_hae_lock, flags);
|
||||
unsigned long result;
|
||||
|
||||
t2_set_hae;
|
||||
|
||||
result = *(vuip) ((addr << 5) + T2_SPARSE_MEM + 0x18);
|
||||
raw_spin_unlock_irqrestore(&t2_hae_lock, flags);
|
||||
return result & 0xffffffffUL;
|
||||
}
|
||||
|
||||
__EXTERN_INLINE u64 t2_readq(const volatile void __iomem *xaddr)
|
||||
{
|
||||
unsigned long addr = (unsigned long) xaddr - T2_DENSE_MEM;
|
||||
unsigned long r0, r1, work, msb;
|
||||
unsigned long flags;
|
||||
raw_spin_lock_irqsave(&t2_hae_lock, flags);
|
||||
unsigned long r0, r1, work;
|
||||
|
||||
t2_set_hae;
|
||||
|
||||
work = (addr << 5) + T2_SPARSE_MEM + 0x18;
|
||||
r0 = *(vuip)(work);
|
||||
r1 = *(vuip)(work + (4 << 5));
|
||||
raw_spin_unlock_irqrestore(&t2_hae_lock, flags);
|
||||
return r1 << 32 | r0;
|
||||
}
|
||||
|
||||
__EXTERN_INLINE void t2_writeb(u8 b, volatile void __iomem *xaddr)
|
||||
{
|
||||
unsigned long addr = (unsigned long) xaddr - T2_DENSE_MEM;
|
||||
unsigned long msb, w;
|
||||
unsigned long flags;
|
||||
raw_spin_lock_irqsave(&t2_hae_lock, flags);
|
||||
unsigned long w;
|
||||
|
||||
t2_set_hae;
|
||||
|
||||
w = __kernel_insbl(b, addr & 3);
|
||||
*(vuip) ((addr << 5) + T2_SPARSE_MEM + 0x00) = w;
|
||||
raw_spin_unlock_irqrestore(&t2_hae_lock, flags);
|
||||
}
|
||||
|
||||
__EXTERN_INLINE void t2_writew(u16 b, volatile void __iomem *xaddr)
|
||||
{
|
||||
unsigned long addr = (unsigned long) xaddr - T2_DENSE_MEM;
|
||||
unsigned long msb, w;
|
||||
unsigned long flags;
|
||||
raw_spin_lock_irqsave(&t2_hae_lock, flags);
|
||||
unsigned long w;
|
||||
|
||||
t2_set_hae;
|
||||
|
||||
w = __kernel_inswl(b, addr & 3);
|
||||
*(vuip) ((addr << 5) + T2_SPARSE_MEM + 0x08) = w;
|
||||
raw_spin_unlock_irqrestore(&t2_hae_lock, flags);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -540,29 +529,22 @@ __EXTERN_INLINE void t2_writew(u16 b, volatile void __iomem *xaddr)
|
||||
__EXTERN_INLINE void t2_writel(u32 b, volatile void __iomem *xaddr)
|
||||
{
|
||||
unsigned long addr = (unsigned long) xaddr - T2_DENSE_MEM;
|
||||
unsigned long msb;
|
||||
unsigned long flags;
|
||||
raw_spin_lock_irqsave(&t2_hae_lock, flags);
|
||||
|
||||
t2_set_hae;
|
||||
|
||||
*(vuip) ((addr << 5) + T2_SPARSE_MEM + 0x18) = b;
|
||||
raw_spin_unlock_irqrestore(&t2_hae_lock, flags);
|
||||
}
|
||||
|
||||
__EXTERN_INLINE void t2_writeq(u64 b, volatile void __iomem *xaddr)
|
||||
{
|
||||
unsigned long addr = (unsigned long) xaddr - T2_DENSE_MEM;
|
||||
unsigned long msb, work;
|
||||
unsigned long flags;
|
||||
raw_spin_lock_irqsave(&t2_hae_lock, flags);
|
||||
unsigned long work;
|
||||
|
||||
t2_set_hae;
|
||||
|
||||
work = (addr << 5) + T2_SPARSE_MEM + 0x18;
|
||||
*(vuip)work = b;
|
||||
*(vuip)(work + (4 << 5)) = b >> 32;
|
||||
raw_spin_unlock_irqrestore(&t2_hae_lock, flags);
|
||||
}
|
||||
|
||||
__EXTERN_INLINE void __iomem *t2_ioportmap(unsigned long addr)
|
||||
|
||||
@@ -318,9 +318,7 @@ extern inline pte_t * pte_offset_kernel(pmd_t * dir, unsigned long address)
|
||||
}
|
||||
|
||||
#define pte_offset_map(dir,addr) pte_offset_kernel((dir),(addr))
|
||||
#define pte_offset_map_nested(dir,addr) pte_offset_kernel((dir),(addr))
|
||||
#define pte_unmap(pte) do { } while (0)
|
||||
#define pte_unmap_nested(pte) do { } while (0)
|
||||
|
||||
extern pgd_t swapper_pg_dir[1024];
|
||||
|
||||
|
||||
@@ -74,8 +74,6 @@
|
||||
# define DBG(args)
|
||||
#endif
|
||||
|
||||
DEFINE_RAW_SPINLOCK(t2_hae_lock);
|
||||
|
||||
static volatile unsigned int t2_mcheck_any_expected;
|
||||
static volatile unsigned int t2_mcheck_last_taken;
|
||||
|
||||
@@ -406,6 +404,7 @@ void __init
|
||||
t2_init_arch(void)
|
||||
{
|
||||
struct pci_controller *hose;
|
||||
struct resource *hae_mem;
|
||||
unsigned long temp;
|
||||
unsigned int i;
|
||||
|
||||
@@ -433,7 +432,13 @@ t2_init_arch(void)
|
||||
*/
|
||||
pci_isa_hose = hose = alloc_pci_controller();
|
||||
hose->io_space = &ioport_resource;
|
||||
hose->mem_space = &iomem_resource;
|
||||
hae_mem = alloc_resource();
|
||||
hae_mem->start = 0;
|
||||
hae_mem->end = T2_MEM_R1_MASK;
|
||||
hae_mem->name = pci_hae0_name;
|
||||
if (request_resource(&iomem_resource, hae_mem) < 0)
|
||||
printk(KERN_ERR "Failed to request HAE_MEM\n");
|
||||
hose->mem_space = hae_mem;
|
||||
hose->index = 0;
|
||||
|
||||
hose->sparse_mem_base = T2_SPARSE_MEM - IDENT_ADDR;
|
||||
|
||||
@@ -25,6 +25,9 @@
|
||||
#ifdef MCPCIA_ONE_HAE_WINDOW
|
||||
#define MCPCIA_HAE_ADDRESS (&alpha_mv.hae_cache)
|
||||
#endif
|
||||
#ifdef T2_ONE_HAE_WINDOW
|
||||
#define T2_HAE_ADDRESS (&alpha_mv.hae_cache)
|
||||
#endif
|
||||
|
||||
/* Only a few systems don't define IACK_SC, handling all interrupts through
|
||||
the SRM console. But splitting out that one case from IO() below
|
||||
|
||||
@@ -35,9 +35,9 @@ extern void kunmap_high_l1_vipt(struct page *page, pte_t saved_pte);
|
||||
#ifdef CONFIG_HIGHMEM
|
||||
extern void *kmap(struct page *page);
|
||||
extern void kunmap(struct page *page);
|
||||
extern void *kmap_atomic(struct page *page, enum km_type type);
|
||||
extern void kunmap_atomic_notypecheck(void *kvaddr, enum km_type type);
|
||||
extern void *kmap_atomic_pfn(unsigned long pfn, enum km_type type);
|
||||
extern void *__kmap_atomic(struct page *page);
|
||||
extern void __kunmap_atomic(void *kvaddr);
|
||||
extern void *kmap_atomic_pfn(unsigned long pfn);
|
||||
extern struct page *kmap_atomic_to_page(const void *ptr);
|
||||
#endif
|
||||
|
||||
|
||||
@@ -263,17 +263,15 @@ extern struct page *empty_zero_page;
|
||||
#define pte_page(pte) (pfn_to_page(pte_pfn(pte)))
|
||||
#define pte_offset_kernel(dir,addr) (pmd_page_vaddr(*(dir)) + __pte_index(addr))
|
||||
|
||||
#define pte_offset_map(dir,addr) (__pte_map(dir, KM_PTE0) + __pte_index(addr))
|
||||
#define pte_offset_map_nested(dir,addr) (__pte_map(dir, KM_PTE1) + __pte_index(addr))
|
||||
#define pte_unmap(pte) __pte_unmap(pte, KM_PTE0)
|
||||
#define pte_unmap_nested(pte) __pte_unmap(pte, KM_PTE1)
|
||||
#define pte_offset_map(dir,addr) (__pte_map(dir) + __pte_index(addr))
|
||||
#define pte_unmap(pte) __pte_unmap(pte)
|
||||
|
||||
#ifndef CONFIG_HIGHPTE
|
||||
#define __pte_map(dir,km) pmd_page_vaddr(*(dir))
|
||||
#define __pte_unmap(pte,km) do { } while (0)
|
||||
#define __pte_map(dir) pmd_page_vaddr(*(dir))
|
||||
#define __pte_unmap(pte) do { } while (0)
|
||||
#else
|
||||
#define __pte_map(dir,km) ((pte_t *)kmap_atomic(pmd_page(*(dir)), km) + PTRS_PER_PTE)
|
||||
#define __pte_unmap(pte,km) kunmap_atomic((pte - PTRS_PER_PTE), km)
|
||||
#define __pte_map(dir) ((pte_t *)kmap_atomic(pmd_page(*(dir))) + PTRS_PER_PTE)
|
||||
#define __pte_unmap(pte) kunmap_atomic((pte - PTRS_PER_PTE))
|
||||
#endif
|
||||
|
||||
#define set_pte_ext(ptep,pte,ext) cpu_set_pte_ext(ptep,pte,ext)
|
||||
|
||||
@@ -358,8 +358,7 @@ static int calc_clk_div(struct clk *clk, unsigned long rate,
|
||||
int i, found = 0, __div = 0, __pdiv = 0;
|
||||
|
||||
/* Don't exceed the maximum rate */
|
||||
max_rate = max(max(clk_pll1.rate / 4, clk_pll2.rate / 4),
|
||||
clk_xtali.rate / 4);
|
||||
max_rate = max3(clk_pll1.rate / 4, clk_pll2.rate / 4, clk_xtali.rate / 4);
|
||||
rate = min(rate, max_rate);
|
||||
|
||||
/*
|
||||
|
||||
@@ -89,13 +89,13 @@ static int adjust_pte(struct vm_area_struct *vma, unsigned long address,
|
||||
* open-code the spin-locking.
|
||||
*/
|
||||
ptl = pte_lockptr(vma->vm_mm, pmd);
|
||||
pte = pte_offset_map_nested(pmd, address);
|
||||
pte = pte_offset_map(pmd, address);
|
||||
spin_lock(ptl);
|
||||
|
||||
ret = do_adjust_pte(vma, address, pfn, pte);
|
||||
|
||||
spin_unlock(ptl);
|
||||
pte_unmap_nested(pte);
|
||||
pte_unmap(pte);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
+14
-9
@@ -36,18 +36,17 @@ void kunmap(struct page *page)
|
||||
}
|
||||
EXPORT_SYMBOL(kunmap);
|
||||
|
||||
void *kmap_atomic(struct page *page, enum km_type type)
|
||||
void *__kmap_atomic(struct page *page)
|
||||
{
|
||||
unsigned int idx;
|
||||
unsigned long vaddr;
|
||||
void *kmap;
|
||||
int type;
|
||||
|
||||
pagefault_disable();
|
||||
if (!PageHighMem(page))
|
||||
return page_address(page);
|
||||
|
||||
debug_kmap_atomic(type);
|
||||
|
||||
#ifdef CONFIG_DEBUG_HIGHMEM
|
||||
/*
|
||||
* There is no cache coherency issue when non VIVT, so force the
|
||||
@@ -61,6 +60,8 @@ void *kmap_atomic(struct page *page, enum km_type type)
|
||||
if (kmap)
|
||||
return kmap;
|
||||
|
||||
type = kmap_atomic_idx_push();
|
||||
|
||||
idx = type + KM_TYPE_NR * smp_processor_id();
|
||||
vaddr = __fix_to_virt(FIX_KMAP_BEGIN + idx);
|
||||
#ifdef CONFIG_DEBUG_HIGHMEM
|
||||
@@ -80,14 +81,17 @@ void *kmap_atomic(struct page *page, enum km_type type)
|
||||
|
||||
return (void *)vaddr;
|
||||
}
|
||||
EXPORT_SYMBOL(kmap_atomic);
|
||||
EXPORT_SYMBOL(__kmap_atomic);
|
||||
|
||||
void kunmap_atomic_notypecheck(void *kvaddr, enum km_type type)
|
||||
void __kunmap_atomic(void *kvaddr)
|
||||
{
|
||||
unsigned long vaddr = (unsigned long) kvaddr & PAGE_MASK;
|
||||
unsigned int idx = type + KM_TYPE_NR * smp_processor_id();
|
||||
int idx, type;
|
||||
|
||||
if (kvaddr >= (void *)FIXADDR_START) {
|
||||
type = kmap_atomic_idx_pop();
|
||||
idx = type + KM_TYPE_NR * smp_processor_id();
|
||||
|
||||
if (cache_is_vivt())
|
||||
__cpuc_flush_dcache_area((void *)vaddr, PAGE_SIZE);
|
||||
#ifdef CONFIG_DEBUG_HIGHMEM
|
||||
@@ -103,15 +107,16 @@ void kunmap_atomic_notypecheck(void *kvaddr, enum km_type type)
|
||||
}
|
||||
pagefault_enable();
|
||||
}
|
||||
EXPORT_SYMBOL(kunmap_atomic_notypecheck);
|
||||
EXPORT_SYMBOL(__kunmap_atomic);
|
||||
|
||||
void *kmap_atomic_pfn(unsigned long pfn, enum km_type type)
|
||||
void *kmap_atomic_pfn(unsigned long pfn)
|
||||
{
|
||||
unsigned int idx;
|
||||
unsigned long vaddr;
|
||||
int idx, type;
|
||||
|
||||
pagefault_disable();
|
||||
|
||||
type = kmap_atomic_idx_push();
|
||||
idx = type + KM_TYPE_NR * smp_processor_id();
|
||||
vaddr = __fix_to_virt(FIX_KMAP_BEGIN + idx);
|
||||
#ifdef CONFIG_DEBUG_HIGHMEM
|
||||
|
||||
+2
-2
@@ -57,9 +57,9 @@ pgd_t *get_pgd_slow(struct mm_struct *mm)
|
||||
goto no_pte;
|
||||
|
||||
init_pmd = pmd_offset(init_pgd, 0);
|
||||
init_pte = pte_offset_map_nested(init_pmd, 0);
|
||||
init_pte = pte_offset_map(init_pmd, 0);
|
||||
set_pte_ext(new_pte, *init_pte, 0);
|
||||
pte_unmap_nested(init_pte);
|
||||
pte_unmap(init_pte);
|
||||
pte_unmap(new_pte);
|
||||
}
|
||||
|
||||
|
||||
@@ -319,9 +319,7 @@ static inline pte_t pte_modify(pte_t pte, pgprot_t newprot)
|
||||
#define pte_offset_kernel(dir, address) \
|
||||
((pte_t *) pmd_page_vaddr(*(dir)) + pte_index(address))
|
||||
#define pte_offset_map(dir, address) pte_offset_kernel(dir, address)
|
||||
#define pte_offset_map_nested(dir, address) pte_offset_kernel(dir, address)
|
||||
#define pte_unmap(pte) do { } while (0)
|
||||
#define pte_unmap_nested(pte) do { } while (0)
|
||||
|
||||
struct vm_area_struct;
|
||||
extern void update_mmu_cache(struct vm_area_struct * vma,
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user